Joomla 自定义模板覆盖不起作用
我想对 Joomla 中的文章使用模板覆盖,因此我使用
I want to use a template override for Articles in Joomla, therefore I am using
mytemplate/html/com_content/article/default.php
如果我更改此文件中的任何内容,更改就会出现.但是因为我想使用额外的 .php 文件 f.e.
If I change anything in this file the changes do appear. But as I want to use an extra .php-file f.e.
mytemplate/html/com_content/article/alternativeLayout.php
我遇到了问题.因为虽然我可以在文章设置页面上选择这个布局 - 我所做的任何更改都不会出现,并且仍然使用 default.php.
I am facing a problem. Because although I can select this layout on the article settings page - any Changes I make do not appear and still the default.php is used.
知道我做错了什么吗?
推荐答案
为了使用替代布局,必须满足两个条件 -
In order for an alternative layout to be used, two conditions must be met -
- 必须在文章参数中选择布局
- 此项目不能存在菜单项 - 菜单项的布局选择将覆盖文章参数中的选择
听起来你的问题是 #2.
It sounds like your problem is with #2.
编辑呃,我错过了使用替代布局的关键部分.为了能够对菜单项使用替代布局,您必须创建一个alternatelayout.xml 文件并将其放置在override 文件夹中.这将为您提供一个额外的菜单项选项,您可以在创建菜单项时选择该选项.您应该能够复制 defailt.xml 文件并针对新布局对其进行编辑.
EDIT Duh, I missed the key part of using alternate layouts. In order to be able to use an alternate layout with a menu item, you have to create an alternatelayout.xml file and place it in the override folder. This will give you an additional menu item option that you select when creating your menu item. You should be able to copy the defailt.xml file and edit it for the new layout.
相关文章