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.

 

MetaTemplate Pro and ZOO

MetaTemplate Pro and ZOO

Hi there,

I have a question about ZOO and MetaTemplate Pro: Is it possible to assign different templates based on different instances of a ZOO app? For example, if I have two blog apps configured within ZOO, to give each one a different template. The only way that I can see at the moment is to include the category ID from the URL as a 'contains' rule, but unfortunately, there are instances where ZOO drops the category ID (for pagination for example) and also, I would like to take advantage of the fact that ZOO 2.2 is more (or less!) compatible with SH404.

Any advice appreciated!

Thanks.

KHD

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

Re: MetaTemplate Pro and ZOO

Hi,

this is an interesting situation because if the menu item links directly to a Zoo category/instance, then the URL itself does not contain the application or category id. Therefore we have to get that info from the Menu system.

This technique will work as long as the category id or application id are not somehow set in the URL. That may be able to happen if there are links to a different application while inside a certain menu item, but I don't know if that happens or not.

In this example I will not show how to detect a different category id in the URL - I will assume that you have followed a menu item to a particular Zoo application.

if ( $option == "com_zoo" ) {
  $menu =& JSite::getMenu();
  $params =& $menu->getParams( $Itemid );
  $appid = $params->get("application");
  if ($appid == 2) return XXX;
  // replace XXX with module id of the module you want to display in Zoo application #2.
}

Hope that helps,
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
3319 Posts
User info in posts
Administrator has disabled public posting

Re: MetaTemplate Pro and ZOO

Oh hang on... I answered the question while thinking about MetaMod (controlling modules). It's only slightly different when dealing with MetaTemplate Pro and templates.

So, use the following:

if ( $option == "com_zoo" ) {
  $menu =& JSite::getMenu();
  $params =& $menu->getParams( $Itemid );
  $appid = $params->get("application");
  if ($appid == 2) return true; // <-- change the application id to check here.
}

This way, if the application id is 2 then this MetaTemplate rule will SUCCEED - therefore, set the desired template in the SUCCEED action.

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

Board Info

Board Stats:
 
Total Topics:
1674
Total Polls:
6
Total Posts:
5917
Total Posts Today:
5
User Info:
 
Total Users:
11537
Newest User:
litz780551
Members Online:
4
Guests Online:
216


Forum Legend:

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