简体   繁体   中英

Joomla Custom Category Blog

I'm working in my own template using Joomla 3.3 and I've created a custom category blog in my template

mytemplate\html\com_content\category

在此处输入图片说明 now I need to make another custom category template, like news.php or products.php.

在此处输入图片说明

what I need is to have multiple custom category blog in my template. and I can select from menu manger the type of category blog template.

在此处输入图片说明

How to accomplish this??

This is already a core feature of Joomla. Simply go to the Module Manager and select any instance of the category blog module and go to the Advanced Settings tab.

The very first field, Alternate Layouts, will be a list of all the template overrides available for that particular module.

Hope that helps.

I've solved this issue by a workaround.

In mytemplate\\html\\com_content\\category/blog.php

I've added some conditional statements like;

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

And in menu manager for the category item I add page class suffex 'x' or 'y'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM