Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

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?

boxcarmib
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

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?

boxcarmib
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

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;

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
3
User Info:
 
Total Users:
4412
Newest User:
doyal54741
Members Online:
1
Guests Online:
190

Online: 
doyal54741

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked