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.

 

How to assign a template to a section/category - not just menu items?

Re: How to assign a template to a section/category - not just menu items?

Ok, glad that's getting sorted out. I hope the makers of the DM Article Titles List PRO module will be able to do some customisation for you.

Best regards,
Stephen

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
3329 Posts
User info in posts
Administrator has disabled public posting

Re: How to assign a template to a section/category - not just menu items?

I am also trying to get a template to show on k2. a specific category (211) and all of it's sub categories and articles.

I've tried
if ( $content_genius->check("category_id = 211") ) return true;
but not changing.
I have joomla 1.5, sef404 (now disabled) and k2 content management.
When I use this same code on category 5, (a non k2 category) it does work and switches the template.

left19
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: How to assign a template to a section/category - not just menu items?

is there any difference between metatemplate and metatemplatpro? would this k2 issue work in metatemplatepro?? It looks like you might be my last chance to get this happening, so I'm anxious to find a solution. Thanks for your help

left19
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: How to assign a template to a section/category - not just menu items?

if ( $core_genius->check("uri contains My-directory") ) return true;

this works on K2

left19
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: How to assign a template to a section/category - not just menu items?

Hi left19,

sorry I didn't get back to you sooner on this. At present there's no explicit K2 support in MetaTemplate (free or pro), but as you found, there are quite useful work-arounds.

In your case, just querying for part of the URL worked, as I assume the category names are part of the URL with SEF URLs activated.

If this isn't sufficient, there will be database queries that can be done to retrieve lots of different information about the K2 item being viewed, but I haven't done a lot of research into this yet.

Anyway, I'm glad it's working ok for you. Write back if you have any more issues with it.

Cheers,
Stephen

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
3329 Posts
User info in posts
Administrator has disabled public posting

Re: How to assign a template to a section/category - not just menu items?

well i ran into a small snafu with that. While this code is perfect

if ( $core_genius->check("uri contains /mydirectory") ) return true;

I have a couple of other conditions, that should exclude it like

but not mydirectory.html
but not /This/mydirectory

I'm just trying to formulate how to say that. I will go a'lookin' and see what comes up, but meanwhile, if you have it off the top of your head, let me know.

Thanks

left19
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: How to assign a template to a section/category - not just menu items?

Ok, if you are familiar with "regular expression" (regex) syntax, you can use this in the JomGenius rule.

Otherwise, you can use some other things:


if ( $core_genius->check("uri ends with /mydirectory") ) return true; // excludes mydirectory.html

if ( $core_genius->check("uri contains /mydirectory") and $core_genius->check("uri not contains /This/mydirectory") ) return true;


Hope that sends you in the right direction
Cheers,
Stephen

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
3329 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1703
Total Polls:
6
Total Posts:
5940
Posts this week:
1
User Info:
 
Total Users:
7398
Newest User:
gobart1ramny
Members Online:
0
Guests Online:
109

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