Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
Recipe for Zoo item
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
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
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.
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
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
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.
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5944
- Posts this week:
- 2
- User Info:
- Total Users:
- 7667
- Newest User:
- humble2601
- Members Online:
- 0
- Guests Online:
- 290
- 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