简体   繁体   English

joomla中菜单项的模板特定参数

[英]Template specific parameters for menu item in joomla

I have a menu in joomla that appears on all pages. 我在joomla中有一个菜单,它显示在所有页面上。 Some of the items in the menu should be the same on every page, while others need to be dynamically updated based on the page the user is on. 菜单中的某些项目在每个页面上都应该相同,而其他项目则需要根据用户所在的页面进行动态更新。 I am trying to create an override for the "external url" menu item type (listed under system links), that would allow me to create a menu item parameter the user could populate. 我试图为“外部URL”菜单项类型(在系统链接下列出)创建替代,这将允许我创建用户可以填充的菜单项参数。 Then, I could use this parameter in the menu template to determine what needs to be added to that particular link. 然后,我可以在菜单模板中使用此参数来确定需要添加到该特定链接的内容。

I understand Joomla overrides for the most part, but I can not figure out where the xml file for these system link menu items is located. 我大部分时间都了解Joomla替代,但是我无法弄清楚这些系统链接菜单项的xml文件位于何处。 If my understanding is correct, overrides should be stored in templates > myTemplate > html > com_myComponent or mod_myModule. 如果我的理解是正确的,则替代应该存储在模板> myTemplate> html> com_myComponent或mod_myModule中。 I would assume if I knew what component the system links fall under, I could create an override for the xml file. 我假设如果我知道系统链接属于哪个组件,则可以为xml文件创建替代。 Is this correct or way off? 这是正确的还是遥遥无期?

TL;DR: Where is the xml file for menu item type "external url"? TL; DR:菜单项类型“外部URL”的xml文件在哪里?

It seems there is no specific xml-files for the system links, as they are defined directly in 似乎没有用于系统链接的特定xml文件,因为它们是直接在中定义的

administrator/components/com_menus/views/menutypes/view.html.php

which means there is no xml-file to override. 这意味着没有要覆盖的xml文件。 You can, however, override the view class MenusViewMenutypes, which is defined in the view.html.php-file. 但是,您可以覆盖在view.html.php-file中定义的视图类MenusViewMenutypes。 This is done by writing a system plugin loading a file containing the same class. 这可以通过编写系统插件来加载包含相同类的文件来完成。 The recipe is simply and beautifully described here . 食谱在这里简单而精美地描述。

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

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