Joomla自定义类别博客

时间:2014-10-06 15:39:28

标签: php joomla joomla3.3

我正在使用Joomla 3.3在我自己的模板中工作 我在模板中创建了一个自定义类别博客

mytemplate\html\com_content\category

enter image description here 现在我需要制作另一个自定义类别模板,例如news.php或products.php。

enter image description here

我需要的是在我的模板中有多个自定义类别博客。我可以从菜单管理器中选择类别博客模板的类型。

enter image description here

如何完成这个?

2 个答案:

答案 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'