Related Items Extended - sort by date created/published
- Posted by Basil Clarke (7) Offline
The old version of Related Items Extended that is on my website has two options for ordering articles that aren't in the latest version: Recently created first; and Article ordering. I've purchased the latest version because I want to start using PHP8, but I would very much like to be able to order by Recently Created First. Is there any way of achieving this?
2 years 9 months ago #1
by Basil Clarke
Please Log in or Create an account to join the conversation.
- Posted by TemplatePlazza (5271) Offline
Hi Sorry for delay in responding. The new version is developed based on the built in joomla related item /similar tag module and it will find the most related item to be displayed first. To change the order will need change to the module core/helper file
2 years 9 months ago #2
by TemplatePlazza
Please Log in or Create an account to join the conversation.
- Posted by Basil Clarke (7) Offline
Thanks.
I've edited helper/RelatedItemsXtdHelperTag.php. I changed line 183 from
$query->order($db->quoteName('c.hits') . 'DESC');
to
$query->order($db->quoteName('created') . 'DESC');
then selected Hits in the back end.
A rather crude way of doing it, but it works.
It would be good though if there was an option to sort by date built in.
2 years 9 months ago #3
by Basil Clarke
I've edited helper/RelatedItemsXtdHelperTag.php. I changed line 183 from
$query->order($db->quoteName('c.hits') . 'DESC');
to
$query->order($db->quoteName('created') . 'DESC');
then selected Hits in the back end.
A rather crude way of doing it, but it works.
It would be good though if there was an option to sort by date built in.
Please Log in or Create an account to join the conversation.
- Posted by TemplatePlazza (5271) Offline
Hmm but changing it that way probably will not return the most 'related' item in correct order.
2 years 9 months ago #4
by TemplatePlazza
Please Log in or Create an account to join the conversation.