简体   繁体   English

不同的Joomla菜单覆盖了不同的Joomla模板

[英]Different Joomla Template Overrides For Different Joomla Menus

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). 我正在使用Joomla v1.7,而mod_mainmenu现在是mod_menu(我想是因为在modules文件夹中没有mod_mainmenu)。 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. 我正在为页眉菜单覆盖mod_menu模板,但是这也会为页脚菜单呈现相同的覆盖html。

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. 感谢您的帮助。

This is very easy to achieve in J1.7. 这在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 模板/模板名称/ html /模块名称/default.php

To make an alternative layout, you simply name it something else - 要进行其他布局,只需将其命名为其他名称-

templates/template name/html/module name/footermenu.php 模板/模板名称/ html /模块名称/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. 只需选择您要使用的那个。

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

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