Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.



Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.


Hide module

Hide module


I'm a complete novice here so sorry - I bet this is a really basic question.  I have a series of videos which are displayed using a JWPlayer module.  I don't want it to appear on some articles - most of them have no menu item.  I believe I can do it with metamod, but my knowledge of php ==null.

Could you help me?   What is the recipe?

I tried:
"if ($content_genius->check("article_id = 34") ) return 117;"

but it while it's moved the player to another part of the page, it hasn't hidden it.  Thanks for your help.


Edited By: dslongstaff
04-Jun-11 06:18:53

Beginner Modder
1 Posts
Administrator has disabled public posting

Re: Hide module

Hi dslongstaff,

I'm not quite sure how the player has moved to a different part of the page... but let me run over a couple of things for you:

1 - instead of thinking of this as "hiding the module on certain pages", think of it as "only including the module if the page is NOT certain pages". MetaMod can't actually prevent modules from appearing(*), but it can include modules where they weren't before.

(*) not quite true: you can with MetaMod Pro, but I'll explain how to do this with the free version

2 - Therefore, the first thing to do is to make sure that your target module (jwplayer) doesn't appear on any pages. It still has to be set up with the right parameters, but I recommend that you set the "Menus" in jwplayer to "none".

3 - Then you set up the MetaMod to selectively include the target module.

4 - Set up the MetaMod for "all" pages, particularly if some of the target pages are pages without a menu item.

5 - Write the PHP rule to only include the module if you're *not* on certain pages, like this example:

if ($content_genius->check("article_id != 34") ) return 117;

If you want it to exclude more than one article page, write it slightly differently:

if ($content_genius->check("article_id = none of 34, 35, 36, 50") ) return 117;

... and if you want to combine more than one exclusion, do it like this:

if ($content_genius->check("article_id = none of 34, 35, 36, 50")
and $content_genius->check("category_id = none of 1, 2, 3" ) ) return 117;

Hope that helps,

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

3330 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
Total Topics:
Total Polls:
Total Posts:
Total Posts Today:
User Info:
Total Users:
Newest User:
Members Online:
Guests Online:

There are no members online

Forum Legend:

 New Sticky