我正在使用Joomla 3.3在我自己的模板中工作 我在模板中创建了一个自定义类别博客
mytemplate\html\com_content\category
现在我需要制作另一个自定义类别模板,例如news.php或products.php。
我需要的是在我的模板中有多个自定义类别博客。我可以从菜单管理器中选择类别博客模板的类型。
如何完成这个?
答案 0 :(得分:0)
这已经是Joomla的核心功能。只需转到模块管理器并选择类别博客模块的任何实例,然后转到高级设置选项卡。
第一个字段Alternate Layouts将是该特定模块可用的所有模板覆盖的列表。
希望有所帮助。
答案 1 :(得分:0)
我通过解决方法解决了这个问题。
在mytemplate\html\com_content\category/blog.php
我添加了一些条件语句,如;
if($this->pageclass_sufx=='x')
echo $this->loadTemplate('item');//which is acts as blog_item.php
elseif($this->pageclass_sufx=='y')
echo $this->loadTemplate('custom');//which is acts as blog_custom.php that I'vecreated
在类别项目的菜单管理器中,我添加了页面类suffex'x'或'y'