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.

 

Sobi2 Recipe to hide module on details page

Sobi2 Recipe to hide module on details page

Hi, I just purchased the MetaModPro. It looks great from the little playing around I've done so far. Nice of you to post simple recipes to help out!

Ok so I have Joomla 1.5 & Sobi 2 directory.

I used your recipe to show a module in the category:

if ( $option == 'com_sobi2' and ($catid = JRequest::getVar('catid')) != '' ) {
  if ( $catid == 17 ) return 199; /* replace 101 with module to show for category 23 */
  if ( $catid == 18 ) return 199; /* replace 102 with module to show for category 34 */
}

Which works wonderfully. Of course I could already do this before I bought your module, but the big problem I have is that I have a search module, which also shows in all the listing detail pages in that category. I want the module to show in the category only. Can you help me modify this recipe to accomplish this, and once it works it could be posted on your recipe page?

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

Re: Sobi2 Recipe to hide module on details page

Hi kool_canuck,

are you saying that module 199 is the search module that you only want to show on the category list pages?

Assuming that's the case, here's how to rewrite your rule above so that module 199 only gets displayed on category list pages, not on the detail pages:

if ( $option == 'com_sobi2'
  and JRequest::getVar('sobi2Task') != 'sobi2Details'
  and ($catid = JRequest::getVar('catid')) != '' ) {
  if ( $catid == 17 ) return 199; /* replace 101 with module to show for category 23 */
  if ( $catid == 18 ) return 199; /* replace 102 with module to show for category 34 */
}

Hope that was what you are after - please let me know if it wasn't.

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: Sobi2 Recipe to hide module on details page

YES!! Works perfectly! This is a great Sobi2 recipe to add!

if ( $option == 'com_sobi2'
  and JRequest::getVar('sobi2Task') != 'sobi2Details'
  and ($catid = JRequest::getVar('catid')) != '' ) {
  if ( $catid == 17 ) return 199; /* replace 199 with module to show for category 17 */
  if ( $catid == 18 ) return 199; /* replace 199 with module to show for category 18 */
}

Thanks a lot!

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

Board Info

Board Stats:
 
Total Topics:
1683
Total Polls:
6
Total Posts:
5940
Posts this week:
11
User Info:
 
Total Users:
5142
Newest User:
zaki98040
Members Online:
0
Guests Online:
225

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