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.

 

Recipe for Zoo item

Recipe for Zoo item

Hi,

I am using the CCK system Zoo (similar to Sobi2). Does anyone has experience to use MetaMod with Zoo? I want to display modules depending on Zoo items.

Thanks and best regards
Rooney

Rooney
Beginner Modder
ranks
useravatar
Offline
16 Posts
Administrator has disabled public posting

Re: Recipe for Zoo item

Hi Rooney,

I haven't used Zoo myself. Is it free to download so I can take a look at it?

If not, then can you provide a URL of a site with Zoo installed, preferably with SEF URLs disabled, so I can see the URL structure and how it corresponds to the different pages on the site?

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

Re: Recipe for Zoo item

Hi,

a free version is available here

http://zoo.yootheme.com/

But I have disabled SEF on the page. The links look like

http://www.servoflo.com/test/index.php? … item_id=49

Thanks a lot for your quick response. Very appreciated!

Rooney

Rooney
Beginner Modder
ranks
useravatar
Offline
16 Posts
Administrator has disabled public posting

Re: Recipe for Zoo item

Thanks for the URLs. These look pretty straight forward.

If you want to display modules for certain items, based on item id, I'd do this:

if ( $option == 'com_zoo' and $view == 'item' ) {
  $item_id = JRequest::getInt('item_id',0);
  if ($item_id == 49) return XXX;
  if ($item_id == 50) return YYY;
  if ($item_id == 51) return ZZZ;
}

Replace XXX, YYY and ZZZ with the module ids to be shown with items 49, 50 and 51 respectively. You can of course add more rules, or use less, as appropriate for your site.

If you want to show modules based on category id, when viewing items (i.e. show a module on all item view pages where the item is in a certain category), you could use this:

if ( $option == 'com_zoo' and $view == 'item' ) {
  $category_id = JRequest::getInt('category_id',0);
  if ($category_id == 83) return XXX;
}

Note that the category that this picks up is the "last" (parent) category that the item is in. So with multi-level hierarchies you don't get direct access to the "grandparent" categories. You could get these from the database if you really need them.

If you want to show modules only on category list pages, according to the category being displayed, you could use this:

if ( $option == 'com_zoo' and $view == 'category' ) {
  $category_id = JRequest::getInt('category_id',0);
  if ($category_id == 83) return XXX;
}

Best regards,
Stephen

p.s. all of these rules will work just the same when SEF URLs are turned on. It was just easier to see what the values should be, with SEF turned off.

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

Re: Recipe for Zoo item

Hi,

I will try it and post the results here. Thanks a lot. Would you mind if I post this on the Zoo board?

Rooney

Rooney
Beginner Modder
ranks
useravatar
Offline
16 Posts
Administrator has disabled public posting

Re: Recipe for Zoo item

Rooney wrote:


I will try it and post the results here.

Works like a charme ;-). Thanks again!

Rooney

Rooney
Beginner Modder
ranks
useravatar
Offline
16 Posts
Administrator has disabled public posting

Re: Recipe for Zoo item

Sure, I'm happy for these to be posted on the Zoo board. If this makes it easier for Zoo sites to show appropriate modules, then so much the better.

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

Re: Recipe for Zoo item

Fantastic! A solution to my problem smile
Where should I add those lines to my site?

Cheers,
Matt.

MattF
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: Recipe for Zoo item

Hi Matt,

these lines need to be inserted into a MetaMod module. You can learn about MetaMod on this site, but I'd recommend these pages to start with:

MetaMod Quick Start
Various Recipe pages - should give you an idea of what's possible with different components (and may help you to understand the Zoo example above).

In a nutshell:
1 - set up the modules that you want to use on the Zoo pages
2 - DISABLE each of those modules so they don't show up
3 - create a MetaMod in the module position where you want the other modules to get included. Make sure THIS one is ENABLED.
4 - adapt the PHP rule in the thread above to your particular circumstances.

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

Re: Recipe for Zoo item

Hi Stephen,

Thanks for the speedy reply, much appreciated.

So I've read up and installed the MetaMod module and followed the steps you suggested, with the following PHP in play:




but all I seem to be getting is  blank box? I've gone through disabling a couple different extensions including advanced module manager to see whether that would help but to no avail.

Just to note, MetaMod shows up in the correct position when enabled, module '95' is set to the desired position, disabled and is not assigned to any menu. Don't know if I've missed something?

Many Thanks,

Matt.

MattF
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Total Posts Today:
2
User Info:
 
Total Users:
4371
Newest User:
kajha63871
Members Online:
1
Guests Online:
140

Online: 
dotcommz

Forum Legend:

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