News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

Main Menu
Support-Forum

Module in alphabetical order?

Started by WildLynxPilot, 25.10.2023 09:59:59

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

WildLynxPilot

Is there any module that can list the available downloads in alphabetical order?
  •  

ColinM

Hi
You can list them in alphabetical order in the main views by using the sort bar but there is no Module that lists them alphabetically.
Could you perhaps explain why you would want such  a view in a module - these are typically located in a sidebar.
Thanks
Colin
Colin M
  •  

WildLynxPilot

Take a look at my site https://fsaddons.fi  - I have two modules in the right column, one with the newest additions or updates in chronological, descending order and one with a list of all the downloadable items. That long list in alphabetical, ascending order would make things much easier for a visitor, as you usually look for airports by the airport code (which I have as the first four letters on all items).

I will try to make an override for the jDownloads Latest module - already found the two lines that need to be changed so it should be easy...
  •  

WildLynxPilot

So it seems that you can not override the helper file in Joomla... :-\  I had to change those two lines in the module itself to accomplish the alphabetical order. Works fine now. Will have to remember to do it after each update until that feature hopefully is included...
  •  

Arno

I could add a sort option in the module. But then it wouldn't really be a 'Latest' module anymore.  ::)
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

ColinM

Hi
@WildLynxPilot
Could you advise which 2 lines in the Latest Module you had to change.

@Arno
Do not think it would not be a problem to have dual purpose module like the Most Rated Module
Colin
Colin M
  •  

WildLynxPilot

In /modules/mod_jdownloads_latest/src/Helper/JDownloadsLatestHelper.php you will find a comment //Set sort ordering. The two lines below that comment!  I changed them from

// Set sort ordering
$ordering = 'a.created';
$dir = 'DESC';


to

// Set sort ordering
$ordering = 'a.title';
$dir = 'ASC';


and that made the trick. The first line for selecting the field (created, published, title etc.) and the second for sort order DESC for descending, ASC for ascending.
  •