Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Hide module on Sobi2 detail...
Hide module on Sobi2 detail page/display module only on front page
Hide module on Sobi2 detail page/display module only on front page
Hi,
I'm using Sobi2 component in my Joomla! CMS. According to the recipes on your website I'm trying to create two recipes with basic version of MetaMod (sorry if some similar subject was in forum, but I can't find a solution and manage with it):
Recipe 1) how to hide some module only on Sobi2 detail page?
Recipe 2) how to display module only on Sobi2 front page (not category or detail view pages)?
PS I'm sorry for posting in wrong forum section
Best regards,
Mark
20-May-11 12:23:29
Re: Hide module on Sobi2 detail page/display module only on front page
Hi Mark,
1 - hide a particular module on a SOBI2 detail page:
if ( ! ($option == "com_sobi2" and JRequest::getVar('sobi2Task') == 'sobi2Details' )) return XXX;
2 - display a module only on Sobi2 front page (not category or detail view):
if ( $option == "com_sobi2" and JRequest::getVar('sobi2Task') == ''
and JRequest::getVar('catid') == '')
return XXX;
In both cases, replace XXX with the module id of the module you want to hide/show.
Hope that helps,
Stephen
Re: Hide module on Sobi2 detail page/display module only on front page
Great!
Thank you very much for help. According these recipes I have a small question:
I) now I'm using MetaMod for hiding my "login module" (left position) for logged in users:
- if ( MM_NOT_LOGGED_IN ) return XX;
- Login Module is disabled, MetaMod (left position)
II) These 2 recipes ("hide a particular module on a SOBI2 detail page" or "display a module only on Sobi2 front page") I would like to use for module in f.e."banner2" position for all users (without any restrictions). Should I use a copy of MetaMod (placed in "banner2" position) or maybe is some easier solution?
Once again thanks for your effort!
Mark
Re: Hide module on Sobi2 detail page/display module only on front page
Hi Mark,
was (I) a question?
For (II), yes, if you want to control a module in a different module position, then you need to create a new MetaMod and put it into that position. In general, use one MetaMod per module position.
Cheers,
Stephen
Re: Hide module on Sobi2 detail page/display module only on front page
metamodguy wrote:
1 - hide a particular module on a SOBI2 detail page:
if ( ! ($option == "com_sobi2" and JRequest::getVar('sobi2Task') == 'sobi2Details' )) return XXX;
Hi Stephen,
I was wondering about how to use this recipe to hide anything in a particular position, not just a module...any ideas?
something witty should go here ! ?
Re: Hide module on Sobi2 detail page/display module only on front page
Yes, 2 ways:
1 - if you are using MetaMod Pro on Joomla 1.6/1.7, then you can use the following syntax:
if (condition here...) $changes->disablePosition("left");
// specify position or comma-separated list of positions.
2 - if you are using any other version (i.e. non-Pro, or on Joomla 1.5), then you can do it a slightly different way. Note that if you are not using a Pro version, then the module position won't "collapse". So this does work effectively on any version of MetaMod Pro.
- let's say your module position to hide is "left"
- assign all of the modules that were in position "left" into a position called "left-switched". You can just type this name into the dropdown for the position.
- make a new MetaMod in the "left" position.
- in the MetaMod, make a condition that conditionally includes all the modules from the "left-switched" position.
e.g.
if (condition here...) return "left-switched";
In this way, the only time modules will get included into the true "left" position is when the MetaMod pulls them all in from the other position. It's also very convenient to do it this way because you just add/remove modules from the left-switched position as if it was the left position - you don't have to touch the MetaMod in order to manage them.
Cheers,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » Hide module on Sobi2 detail...
Board Info
- Board Stats:
- Total Topics:
- 1699
- Total Polls:
- 6
- Total Posts:
- 5967
- Total Posts Today:
- 2
- User Info:
- Total Users:
- 8021
- Newest User:
- shrutihassan193
- Members Online:
- 0
- Guests Online:
- 192
- 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