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 Modules on ALL VirtueMart pages, but otherwise...

Hide Modules on ALL VirtueMart pages, but otherwise...

So, I am sure I am missing something obvious and I will apologize in advance for this...

I am using Joomla 1.5.26 with VirtueMart 1.1.9 and MetaMod 2.12.

All I want to do is to prevent certain modules from appearing anywhere in VirtueMart.  Otherwise, I want the normal module display parameters to work as usual (as controlled in the module manager). 

For example, I put in this "rule" since I do not use the "VirtueMart FrontPage" I figured that it would eliminate display of the modules by default...:

$vm = JomGenius("virtuemart");
if ( $vm->check( "pagetype = frontpage" ) ) return 115;
if ( $vm->check( "pagetype = frontpage" ) ) return 119;
if ( $vm->check( "pagetype = frontpage" ) ) return 56;

but it only seems to stop module 56 from being displayed--and even then it is not consistent.  For example, module 56 displays on category pages, but not product details pages. 

Thanks in advance... I've been reading this forum for over an hour and I need to get this done...

Edited By: izrunas
21-Nov-12 14:12:12

Beginner Modder
1 Posts
User info in posts
Administrator has disabled public posting

Re: Hide Modules on ALL VirtueMart pages, but otherwise...

Hi izrunas,

I would just do the following, which detects all VM pages, and shows the module on everything else:

if ($option != 'com_virtuemart') return 56;

This will show module 56 on all pages that the MetaMod is assigned to [that's an important distinction] *except* any pages based on the VirtueMart component.

Now, if you have several different modules all in the same module position that you want to hide/show, you can include them all like this:

if ($option != 'com_virtuemart') return "56, 115, 119";

Or, if the 3 modules you want to control are all in different module positions, then you need to put a MetaMod into each of the module positions, and control each module with a separate MetaMod. Make sense?

Best regards,

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:
Posts this week:
User Info:
Total Users:
Newest User:
Members Online:
Guests Online:

There are no members online

Forum Legend:

 New Sticky