I am currently creating a template for Joomla v.3.9. The accordion menu is already included. For this I made an "Override" by copying the folder "mod_menu" into the template folder and adjusting it. So far so good.

Now I'm struggling to adjust the structure of the a-tag:

<li item-241 deeper parent><a href="#" title="changethecolor" class="fi-foot"> Rathaus</a>

I want to move the title-Attribute to the li-Tag. For example:

<li item-241 deeper parent background-color="changethecolor"><a href="#" class="fi-foot"> Rathaus</a>

At the moment, i'm looking for the right file to change it.

Maybe one of you can tell me which file I have to edit or how I have to start?!

  • Might it be simpler to just use javascript to move the attribute value? Is changethecolor the actual text? or is it an actual color. background-color="changethecolor" doesn't look like valid markup to me, but maybe it is for the template. Do you no longer want the behavior that comes with title in the <a> tag? If you want to recolor the listitem, maybe just use css. Can you explain more about your coding intention? – mickmackusa Nov 15 at 23:12
up vote 0 down vote accepted

I made an "Override" by copying the folder "mod_menu" into the template folder

You only need to copy files from modules/mod_menu/tmpl/ folder, not the whole modules/mod_menu/ folder. The files must be placed in templates/your_template/html/mod_menu/folder to be detected.

The folder contains the main default.php layout which loads a specific layout for each menu item based on menu item type. To remove the title, edit type-specific layouts (default_component.php, default_heading.php, default_separator.php and default_url.php). And to add title to <li> element edit the main layout.

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.