2014-10-06 83 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將成爲該特定模塊可用的所有模板覆蓋的列表。

希望有所幫助。