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.

 

Disable module

Disable module

Hello a would like to disable module for all page exept items for category x , but I d'ont know the solution for metamod
for information I have a solution in only metamodpro : $changes->mod( 197 )->disable();

but is not work in metamod free , please have you a solution for that , thnx

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

Re: Disable module

Hi khmadi,

You're right, that method will only work in Pro.

In the free version (and in most normal usage) you can achieve the same thing by using MetaMod to only show a module under certain situations. This is just the same as disabling the module under the opposite conditions.

Here's how to make a module appear on all pages EXCEPT category pages of category 123 and article pages where the article is in category 123:

1 - prepare your "target" module (the one you want to disappear)
2 - take a note of the module id of the target module
3 - set up the target module to NOT appear. Either set it to display on no menu items, or set it to appear on a non-existant module position. In this way, it won't appear until the MetaMod includes it.
4 - set up the MetaMod using the following PHP:

if ($content_genius->check("category_id != 123")) return XXX;
// replace 123 with the category id you want to hide it on
// replace XXX with the module id of the target module.

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

Re: Disable module

thank you very much

if ($content_genius->check("category_id != 123")) return XXX;

but How can I use it in k2 pages

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

Re: Disable module

Ah, K2, that's a different kind of category. The PHP code I suggested is only for standard content categories. You need to be specific when you ask for support, including information about which component you are dealing with.

I'm currently working on K2 support within JomGenius, for MetaMod and Chameleon. I hope that preliminary support (detecting the different K2 page types, and being able to query specific information about what category is being displayed, or other info about the current page)  will be available next Monday 29th April. Please stand by for new versions made available on that day. I could send you some code to detect K2 category now, but would rather wait for the official support in the products.

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

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
4
User Info:
 
Total Users:
4384
Newest User:
rash39381
Members Online:
1
Guests Online:
124

Online: 
metamodguy

Forum Legend:

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