简体   繁体   中英

How can I add “id” attribute to menu link on Joomla3?

I need to add attribute to my menu links generated in Joomla. 属性。 Actually they are displayed like

<li>
<a href="/site/index.php">INICIO</a>
</li>

AND i need:

<li>
<a id="SOME-ID" href="/site/index.php">INICIO</a>
</li>

If you're using Joomla! default menu module, either you edit the menu module file located in: /modules/mod_menu/tmpl/default_url.php or you can use jQuery to add the id's according with your preferences and needs. The first approach would be preferable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM