不同的 Joomla 模板覆盖不同的 Joomla 菜单
我正在使用 Joomla v1.7,mod_mainmenu 现在是 mod_menu (我想,因为模块文件夹中没有 mod_mainmenu)。在我的网站中,像大多数网站一样,我有两个菜单,一个位于页眉,另一个位于页脚。页眉菜单要复杂得多,带有下拉菜单,而页脚菜单只有四个链接。我正在覆盖页眉菜单的 mod_menu 模板,但这也会为页脚菜单呈现相同的覆盖 html。
如何为两个单独的菜单进行两个单独的覆盖。在页脚中,我正在考虑对锚标记进行硬编码,但这将使我的客户很难在页脚中添加或删除链接。我该怎么做?是否可以?
谢谢!
我很感激你的帮助。
I am using Joomla v1.7 and the mod_mainmenu is now mod_menu (I think, because there is no mod_mainmenu in the modules folder). In my site I have two menus like most sites, one in the header and another one in the footer. The header menu is a lot more complex with drop downs, while the footer menu simply has four links. I am in the process of overriding the mod_menu template for the header menu but that would also render the same overridden html for footer menu.
How do I make two separate overrides for two separate menus. In the footer I was thinking of hardcoding anchor tags, but that would make it difficult for my client to add or remove links from the footer. How do I do this? Is it possible?
Thanks!
I appreciate the help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这在 J1.7 中很容易实现。您只需使用模块替代布局即可。这些工作方式与模板覆盖非常相似。通常,对于模板覆盖,您将创建此文件 -
templates/template name/html/module name/default.php
要创建替代布局,您只需将其命名为其他名称 -
templates/template name/html/module name/footermenu.php
只需确保文件名不包含任何下划线即可。设置此文件后,它将显示在替代布局下的高级选项模块中。只需选择您想要使用的那个即可。
This is very easy to achieve in J1.7. You simply use a module alternative layout. These work very similar to a template override. Normally for a template override you would create this file -
templates/template name/html/module name/default.php
To make an alternative layout, you simply name it something else -
templates/template name/html/module name/footermenu.php
Just make sure that the file name does not contain any underscores. Once you have set up this file, it will appear in the module Advanced Options under alternative Layout. Just select the one you want to use.