我理解并热爱模板覆盖。我需要对菜单输出进行一些重大更改(基本上是使输出与Bootstrap更好地配合)-但仅适用于某些菜单。
目前在Joomla 3中,mod_menu/tmpl
文件夹中有以下内容:
default.php
default_component.php
default_heading.php
default_separator.php
default_url.php
如果我想更改类别,我会将default.php复制到
mytemplate/html/mod_menu
中并进行更改。非常好,没有问题。如果我想更改链接输出以适应此,则可以将default_component.php复制到
mytemplate/html/mod_menu
中并进行更改。很好,没有问题。如果我想选择一个不同的“替代布局”,我会将
mytemplate/html/mod_menu/default.php
重命名为newlayout.php
,然后在菜单的管理员模块中选择它。 很好,没有问题。这里是问题:如果我想更改某些菜单的链接输出而不是所有菜单,我认为我会像上面那样将
default_component.php
更改为newlayout_component.php
,这将对应于newlayout.php
......但是那样行不通。问题:
1)如何为每个
default_component.php
、default_heading.php
、default_separator.php
、default_url.php
模板文件具有替代布局(而不仅仅是覆盖)?2)我认为
default_url.php
是会影响链接输出的文件,但似乎是default_component.php
起作用。那每个文件都是做什么的?我在joomla.org上找不到任何信息。谢谢!