我正在使用Joomla3.3在我自己的模板中工作,我在模板中创建了一个定制的类别博客
mytemplate\html\com_content\category

现在我需要做另一个自定义类别模板,比如news.php或products.php.。

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

如何做到这一点??
发布于 2014-10-07 00:13:08
我已经解决了这个问题。
在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
在菜单项管理器中,我添加了页面类后缀'x‘或'y’。
发布于 2014-10-06 22:27:56
这已经是Joomla的一个核心特性。只需转到Manager并选择类别博客模块的任何实例,然后转到选项卡。
第一个字段,备用布局,将是可用于该特定模块的所有模板重写的列表。
希望这能有所帮助。
https://stackoverflow.com/questions/26219794
复制相似问题