Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Change Template on Article Category
Change Template on Article Category
Change Template on Article Category
I thought that I could use Chameleon for what I thought would be a simple task.
I created an enabled rule, that only has only one parameter... in "Content and Components" I select a single category from these available to me, and then in actions/succeed window I select the template style I want to display whenever an article of the selected category is displayed. But nothing happens.
Am I missing something? Do other parameters need to be set?
Re: Change Template on Article Category
Hmmm.... I figured it out.. Chameleon doesn't factor in treed categories, which is kind of disappointing. e.g. If I have an article category named "Box Sizes" and then a subcategory under that named "Small", select "Box Sizes" in Chameleon as the category rule on which to switch the template on doesn't work. I have to set it to "Small". Is this a feature, or something that might be addressed in a future release?
Re: Change Template on Article Category
There isn’t actually a GUI control for this (I should definitely add that!) but it’s easy to add with a snippet of PHP in the PHP tab of Chameleon:
if ($content_genius->check("ancestor_category_ids = 5,6,7")) return true;
What that does is that if any ancestor (higher level category) of the current category is 5 or 6 or 7, then make the rule succeed. i.e. all categories that descend from these ones will trigger the rule.
If you want to include the ancestor category itself as well, you can do this:
if ($content_genius->check("ancestor_category_ids = 5,6,7")
or $content_genius->check("category_id = 5,6,7")
) return true;
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Change Template on Article Category
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5943
- Posts this week:
- 2
- User Info:
- Total Users:
- 7642
- Newest User:
- mary26
- Members Online:
- 0
- Guests Online:
- 169
- 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