Feature No Code Attached Yet
avatar leetempest
leetempest
29 May 2024

Is your feature request related to a problem? Please describe.

Kind of! There is no option within the Related Articles module to select how to display the articles, wether this is sorted by date ascending / descending, featured, article order etc.
Currently the module displays the selected number of articles in ascending date order, which on my clients site is displaying articles dated back in 2011.

Describe the solution you'd like

An option within the module config to select how the related articles are sorted and displayed.

Additional context

avatar leetempest leetempest - open - 29 May 2024
avatar joomla-cms-bot joomla-cms-bot - change - 29 May 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 29 May 2024
avatar leetempest
leetempest - comment - 29 May 2024

So found a 'hack' to the RelatedItemsHelper.php file by adding:

->order('a.id DESC');

after line 116.

However this will be over written on any Joomla update I suspect.

avatar chmst chmst - change - 29 May 2024
Labels Added: Feature
avatar chmst chmst - labeled - 29 May 2024
avatar drmenzelit
drmenzelit - comment - 29 May 2024

It is not a good idea to do changes in core files ;-)
What you can do is create an override for the module and add

usort($list, function($a, $b) {
    return strtotime($b->created) - strtotime($a->created);
});

after line 18, that will display the newest article first.

avatar brianteeman
brianteeman - comment - 29 May 2024

The new (not ready yet) combined content module will support this functionality

avatar rdeutz rdeutz - change - 1 Jun 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-06-01 12:48:08
Closed_By rdeutz
avatar rdeutz rdeutz - close - 1 Jun 2024
avatar rdeutz
rdeutz - comment - 1 Jun 2024

As Brain said we are planning to work on the article modules for Joomla6 and this will include something you need. Because of the limited resources we have I don't want to spend time on the current modules. So I am closing this. Would be great when you check the new version of the article module when done and test.

Add a Comment

Login with GitHub to post a comment