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.

 

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

izrunas
Beginner Modder
ranks
useravatar
Offline
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

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
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:
4378
Newest User:
miller2341
Members Online:
3
Guests Online:
187


Forum Legend:

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