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.

 

How do i disable left modules on one specific virtuemart category?

How do i disable left modules on one specific virtuemart category?

Joomla 2.5.14.
Virtuemart 2.0.22b.
------------------------

We have one category that we do not wish the left sidebar menu or modules to load - we dont even want the sidebar position at all to load, we just simply want the category itself to be full page.

Any ideas? I am so confused as to which recipe to use.

ecopure
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

Re: How do i disable left modules on one specific virtuemart category?

Hi Ecopure,

1 - your template has to be able to "collapse" a module position when there are no modules published in it. Is this what happens already? i.e. if you temporarily unpublish all the modules in the "left" position, does the left column collapse and let the content take the full page? If not, MetaMod can't help that part. (but most templates do this).

2 - in order for the collapse to take place, you will need to be using the Pro version of MetaMod. This is because in the Free version, when you publish a MetaMod into a module position, the module position will always think that there is a published module there, so will never collapse. In the Pro version, even when you publish a MetaMod into that position, it will "disappear" (and allow the module position to collapse) if/when the MetaMod decides not to publish something inside itself. Clever!

3 - Instead of using MetaMod to turn on/off individual modules. I'd set it up in a different way. Let's assume that your normal left column is called module position "left".

Edit all the modules that were previously in the "left" position, and put them into a position called "left-metamod". You can just type in that position into the module position box when editing the module (you don't have to use the dropdown).

THEN create a MetaMod and put it into the real "left" position. In the MetaMod PHP rule (see below) you would tell it to return "left-metamod";

The reason for doing that is that if you even want to include other modules into the left column, you don't really want to have to edit the MetaMod to include/exclude them. It's far easier just to put them into the "dummy" position and shuffle them around in there, and let the MetaMod pull in the entire "dummy" position when it decides it's on the right page to do this.

4 - the PHP to use would be something like this. Edit "123" to be the category you want to exclude:

$vm = JomGenius("virtuemart");
// short-circuit if we are on that specific category:
// i.e. return nothing if we are on that category.
if ( $vm->check("pagetype = category") and $vm->check("categoryid = 123")) return;
// for every other page, display the modules from the dummy position:
return "left-metamod";


Hope that 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
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1681
Total Polls:
6
Total Posts:
5912
Posts this week:
6
User Info:
 
Total Users:
11501
Newest User:
riley58745
Members Online:
0
Guests Online:
157

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