2

I am using Joomla 3.8.0, and I have made an override for the mod_articles_archived module. For some reason it doesnt read the override? I have the following map structure now:

templates/mytemplate/html/mod_articles_archive/helper.php

Does anyone know how to fix this problem?

  • 1
    Unfortunately you cannot override a module's helper.php file. You can only override the view (mod_articles_archive/tmpl/default.php). What exactly are you wanting to change in the helper? If you let us know, perhaps we can help come to another solution. – Lodder Oct 24 '17 at 8:53
  • I am trying to change the query in the helper.php, because I have a menu that is build up by the dates of archived articles. But it shows the month and the year, and I want it to only show the years. Now is is like: may - 2007 april - 2007 may - 2006 june - 2008 and I want it: 2008 2007 2006 But the weird part is, when I made an override through Joomla, it made the helper.php? – Brum Oct 24 '17 at 8:58
1

Ah right, now that I know what you wish to achieve, this is a very simple task that doesn't require any code changes :)

This text you want to change derives from a language string:

MOD_ARTICLES_ARCHIVE_DATE="%1$s, %2$s"

Where %1$s is the month, and %2$s is the year.


Solution:

In you Joomla backend, go to: Extensions >> Language >> Overrides >> New

In the Language Constant field, add MOD_ARTICLES_ARCHIVE_DATE

In the Value field, add %2$s


Screenshot:

enter image description here


Result:

enter image description here


Hope this helps

  • Thank you, but I need to combine the months from a whole year in to one year in one menu item, so you can click on a year and then you will get all articles from that year. This means that I need to also change the link that is created in helper.php and also the query, because the list is created by the amount of rows, so if I remove the monts in the query, I am only getting the years, and that is what I want. Sorry for my very very vague question. – Brum Oct 24 '17 at 9:26
  • Would you happen to know how to do that? – Brum Oct 24 '17 at 9:54
  • @Brum - Perhaps take a copy of the module, change the name and class, then install it. You can then change the helper.php file as if it were your own module. Other than that, there may be some way to extend the class, however I'm not a PHP developer so wouldn't be the best person to ask. Or you can check the Joola Extensions Directory to see if any archiving extensions exist. – Lodder Oct 24 '17 at 10:00
  • That worked thanks for the help! :D – Brum Oct 24 '17 at 13:19

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.