joomla-cms
joomla-cms copied to clipboard
[4.2] [GSoC 21] Core Enhancement 3 - Merge Featured into Articles
Project Repo PR: https://github.com/joomla-projects/gsoc21_core-enhancements/pull/11 Plan Document: https://docs.google.com/document/d/1Pl8JGa2hkYkmJzQOn9_mS8a4imDmqc2a/edit#heading=h.t5tri5tytv7q
- [x] Drop-down selector in Articles view
- [x] Merge Model
- [x] Merge tmpl files
- [x] Merge View
- [x] Merge Controller
- [x] Update all links pointing to
view=featured - [x] Update Link of Featured Articles Menu Item
- [x] Remove Featured files
Summary of Changes
[A] New Selector Dropdown
A searchtools selector is added that can be used to toggle between:
| Option | Value |
|---|---|
| All | "" |
| Unfeatured | 0 |
| Featured | 1 |

[B] Model Merged
- A new method to return the featured selector filter parameter using the getUserState from request
$featured = $this->getUserStateFromRequest($this->context . '.featured', 'featured', '');
- The advantage of the above is that we can also pass the value as a GET param to the URL which helps us to make redirect URLs that can initialize the value of this dropdown
$featuredvariable is used as a condition to manipulate the query to adjust to Featured
[C] Templates Merged
- We use
state->get('featured')to conditonally render the template code as per featured or not.
[D] Views Merged
- We use
state->get('featured')to conditonally render the toolbar options
[E] Controller Merged
- Merged the delete function from FeaturedController
Testing Instructions
- Visit the Articles View and ensure that everything works as it did before.
- Test workflows and filters too
- Ensure that the tmpl and view (and all other MVC files) are common for both featured and articles
Expected result AFTER applying this Pull Request
Everything works normally
Mentors
@chmst @nibra @bembelimen (and thanks @richard67)
Does this fix https://github.com/joomla/joomla-cms/issues/29942 ?
Does this fix #29942 ?
Sadly, No. I haven't made any change that affects this.
If you only moved the "Featured" filter to set it using GET, that works as well with: /administrator/index.php?option=com_content&view=articles&filter[featured]=1.
Sorting by Featured does not update the icon-sort to caret up/caret down.
Updates:
- This has been fixed:
Sorting by Featured does not update the icon-sort to caret up/caret down.
- All old files related to featured articles have been deleted
Will Featured Articles in the sidebar be removed?
Will
Featured Articlesin the sidebar be removed?
No, it will stay but it's navigation url will be different. This new url will point to the articles (instead of featured) view and it will pass the filter of featured=1 that will be applied in the search tools to only show featured articles
Two menu items are highlighted. Also, see #28003 for request to remove it.

The double highlighting is because of an unrelated bug in menu highlighting
#19886 could be obsolete for 4.x with this PR
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35228.
Apologies for the review request, I rebased my branch to fix the merge conflicts and it automatically requested for review when I pushed it
Review request can be removed by using the cog icon beside the reviewers list on the top ~~left~~ right corner, and then choosing the reviewer which has a check mark in the drop down.
Thank you!
Thinking loud, because there was a question in a forum aboout a template override for the featured layout. Can this remain unchanged?
@YatharthVyas We have a conflict :fearful: Can you check it please?
@YatharthVyas We have a conflict 😨 Can you check it please?
Thanks, I have rebased it now
Thinking loud, because there was a question in a forum aboout a template override for the featured layout. Can this remain unchanged?
Sorry, I am unware about this.I would like to read more information about the forum question
Now I am sorry, I cannot find the post.
The user had an own template override for the featured articles (tmpl/featured/default.php). This remembered me that featured articles can have a very different layout than other articles or blog layouts.
Install Blog Sample Data.
Go to the front page.
Error: The requested page can't be found.
Install Blog Sample Data.
obviously as the plugin is not updated in this pr
Enable Workflows. Go to Actions dropdown. Missing Run Transitions and Unfeature should not be listed.

obviously as the plugin is not updated in this pr
The issue is that the update sql should update the backend only and not the frontend too.
obviously as the plugin is not updated in this pr
The issue is that the update sql should update the backend only and not the frontend too.
@Quy Yes, the update SQL statement is missing a condition for client_id = 1 in the WHERE clause.
@YatharthVyas Could you change that, and change the name of the update SQL scripts from "4.1.0-2021-08-09.sql" to the right version 4.2.0 and a more current date, e.g. "4.2.0-2022-03-27.sql"? If you can, remember to do the file rename and the file content change with separate commits so GitHub history shows the file has been renamed and changed and not shows a deleted and a created file.
@obuisard this wasn't accepted for 4.2 - no idea why - will it be accepted for 4.3 (if updated). If not then the creator should be informed and this closed. (which will be a shame) but there is no point in leaving it open otherwise
Thank you @brianteeman for pointing this out. We are going to contact student and mentor about this enhancement as it was a GSoC project. We will also double-check with the UX team on this one.
This pull request has been automatically rebased to 5.0-dev. No new features will be merged into Joomla! 4.3 series. Joomla! 4.4 series is a bridge release to make migration from Joomla! 4 to 5 as smooth as possible.
This pull request has been automatically rebased to 5.1-dev.
This pull request has been automatically rebased to 5.2-dev.