简体   繁体   English

如何在joomla的菜单项中添加新属性

[英]How to add a new attribute in menu item in joomla

I want to add a new attribute "rel" in a menu item in joomla. 我想在joomla的菜单项中添加新的属性“ rel”。 To add display a modal box on click of menu item I need to add "re" attribute. 要添加显示在菜单项上单击的模式框,我需要添加“ re”属性。 for eg at present the menu item is - <a href="#" class="someclass"> ... </a> I want - <a href="#" class="someclass" rel"something"> ... </a> 例如,当前菜单项是- <a href="#" class="someclass"> ... </a>我要- <a href="#" class="someclass" rel"something"> ... </a>

After a research I found that updating a file - /modules/mod_menu/tmpl/default_url.php should help. 经过研究,我发现更新文件-/modules/mod_menu/tmpl/default_url.php应该会有所帮助。 But when I am trying to update this file it does not reflect any changes on joomla backend. 但是,当我尝试更新此文件时,它无法反映joomla后端的任何更改。

Can anyone please suggest what should be the possible solution? 谁能建议应该采取什么解决方案?

TIA TIA

Obviously, your file "/modules/mod_menu/tmpl/default_url.php" is for site/frontend menu, not for the administrator/backend menu. 显然,您的文件“ /modules/mod_menu/tmpl/default_url.php”用于站点/前端菜单,而不用于管理员/后端菜单。

However, regardless of frontend and backend, if you want to modify any view of joomla's components or modules or layouts, then you must override it in your template's html folder. 但是,无论前端和后端如何,如果要修改joomla的组件,模块或布局的任何视图,则必须在模板的html文件夹中覆盖它。

In your scenario, your file should reside in "/templates/mytemplate/html/mod_menu/default_url.php" 在您的方案中,您的文件应位于“ /templates/mytemplate/html/mod_menu/default_url.php”中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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