2014-10-06 161 views
0

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

mytemplate\html\com_content\category 

enter image description here 现在我需要做其他自定义类别模板,如news.php或products.php。

enter image description here

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

enter image description here

如何做到这一点?

回答

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'

0

这已经是Joomla的核心功能。只需转到模块管理器并选择类别博客模块的任何实例,然后转到高级设置选项卡。

第一个字段Alternate Layouts将成为该特定模块可用的所有模板覆盖的列表。

希望有所帮助。