Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » ChameleonLite
- » Assign template to Sectionblog page,...
Assign template to Sectionblog page, another to the single article
Assign template to Sectionblog page, another to the single article
Hi
I need to assign a template to some of the sectionblog pages of my site and another one to the relative articles.
At this moment if I assign a template to the menu item linked to the blogsection pages, the articles get the same template too (not the default one).
Is this possible with your component? it is very diffucult for me to understand how it works.
Re: Assign template to Sectionblog page, another to the single article
Hi theant,
this is pretty simple to achieve with MetaTemplate.
TECHNIQUE 1: All in the same MetaTemplate rule:
Create a MetaTemplate rule and use the following recipe in the Advanced PHP box:
if ($option == "com_content" and $view == "article") return "TEMPLATENAME1";
if ($option == "com_content" and ( $view == "section" or $view == "category") ) return "TEMPLATENAME2";
TECHNIQUE 2: Use 2 separate rules, one that detects articles and one that detects sections/categories:
a - set up the 1st rule
b - enter this into the Advanced PHP box:
if ($option == "com_content" and $view == "article") return true;
c - Then in the SUCCEED action, use the drop-down to select the template to be used for articles.
d - save that rule and create a second rule
e - use the following PHP in the second rule:
if ($option == "com_content" and ( $view == "section" or $view == "category") ) return true;
f - Then in the SUCCEED action, use the drop-down to select the template to be used for categories/sections.
g - save the rule and test it out.
Done.
Cheers,
Stephen
Re: Assign template to Sectionblog page, another to the single article
In that case, I'd change the second rule to this:
if ($option == "com_content" and $view == "section" and $id == 1 ) return true;
if ($option == "com_content" and $view == "section" and $id == 2 ) return true;
if ($option == "com_content" and $view == "section" and $id == 3 ) return true;
if ($option == "com_content" and $view == "category" and $id == 1 ) return true;
if ($option == "com_content" and $view == "category" and $id == 2 ) return true;
There are more elegant ways to express this in PHP, but it's probably easier to understand in this form.
Hope that helps,
Stephen
- Index
- » Chameleon / ChameleonLite
- » ChameleonLite
- » Assign template to Sectionblog page,...
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5944
- Posts this week:
- 2
- User Info:
- Total Users:
- 7658
- Newest User:
- carre82601
- Members Online:
- 0
- Guests Online:
- 101
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked