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?

2
  • 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, 2017 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, 2017 at 8:58

1 Answer 1

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

3
  • 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, 2017 at 9:26
  • Would you happen to know how to do that?
    – Brum
    Oct 24, 2017 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, 2017 at 10:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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