问题描述
我想在Joomla中为Articles使用模板替代,因此我正在使用
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.
有任何想法我在做什么错吗?
Any ideas what I am doing wrong?
推荐答案
要使用替代布局,必须满足两个条件-
In order for an alternative layout to be used, two conditions must be met -
- 您必须在文章参数中选择布局
- 该菜单项不能存在-菜单项的布局选择将覆盖文章参数中的选择
听起来您的问题出在2号上.
It sounds like your problem is with #2.
编辑h,我错过了使用替代布局的关键部分.为了能够将替代布局与菜单项一起使用,必须创建alternatelayout.xml文件并将其放置在override文件夹中.这将为您提供一个额外的菜单项选项,您可以在创建菜单项时选择该选项.您应该能够复制defailt.xml文件,并为新的布局对其进行编辑.
EDITDuh, 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.
这篇关于Joomla自定义模板覆盖不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!