Alphalist list for journals only display letters with journals

Hi:

When enabling “For sites with many journals, show an alphalist on the homepage allowing for quick alphabetical navigation between journals.” it would be great if only would appear the letters that have journals.

Greetings.

Hi @alonsoj,

Our development focus is currently on OJS 3.0, so this isn’t a huge priority for us – but do you have any PHP/MySQL expertise on hand? If so, I could suggest where to start.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi,

Yes, I have knowledge of PHP/MySQL.

Greetings.

Hi @alonsoj,

The page you’re wanting to change is implemented in pages/index/IndexHandler.inc.php in the index function (the controller), and templates/index/site.tpl (the view). The most expedient way to do this is probably to convert the $journals variable from an ItemIterator (a custom iterator class) to an array, permitting you to go through and figure out which initial letters are relevant to your installation. To do this,

$journals = $journals->toArray();

You’ll then need to change the {iterate ...} Smarty call into a more conventional {foreach ...}; see the Smarty documentation for more information on syntax.

Because this requires loading the entire list of journals into memory at once, it’s probably not suitable in general – but if you have a limited number of journals it should work OK.

Regards,
Alec Smecher
Public Knowledge Project Team