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.

 

Virtuemart, hidding module

Virtuemart, hidding module

Hello!

I'vs just discovered MetaMod and need your help to use it.
I've got a VirtueMart link on my homepage, and i'd like to make two of my module to disappear when i'm going on it. I can't figure how to do it as i'm a beginner in PHP.

Can you help me ?

(Bad english speaker: i'm French..)

Thanks wink

TipX
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Virtuemart, hidding module

Hi TipX,

I just need to check a few details. Firstly, can you tell me what type of page the link links to? When you click on it, do you go to:
1 - VM's "front page"
2 - some other category listing in VM
3 - any other page in VM?

Also, you say that you want 2 modules to disappear. Are these modules on your site home page, or on the page that you link to?
And, on which pages do you want them to disappear?

I *think* you mean that you have 2 modules that are assigned to "All" pages, but you want them to disappear when the user is on any VM pages. Is that correct?

Cheers,
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
3312 Posts
User info in posts
Administrator has disabled public posting

Re: Virtuemart, hidding module

Hi!

My link is on my "classic" homepage and is going to my VM front page.

I've got 2 module (id: 12 & 15) on my homepage, and i want them to disappear when i'm going on my shop (on every single page of my shop).

Hope you understand what i mean .

Thanks anyway.

TipX
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Virtuemart, hidding module

Hi TipX,

The way that MetaMod works is this:

MetaMod is a module, with some special abilities: it is able to embed other modules inside itself, according to rules that you set up.

Looking at this simply, it's not able to stop other modules from appearing on the page.

However, if you look at your situation slightly differently, MetaMod can achieve what you want to achieve.

Here's how:
- As long as your target modules don't appear on the page via the normal module assignment system, MetaMod is able to control whether or not they appear, simply by either including them or not including them inside itself.

So it's just a matter of turning the "normal" modules off, then selectively including them inside the MetaMod.

Turning them off: there are several ways to achieve this. e.g. you can "disable" / unpublish them. Or, set them to display on menu items: "none". That stops them showing outside of MetaMod.

Selectively including them inside Metamod:
1 - make a new Metamod, and assign it to "all" pages. Turn off the MetaMod title.
2 - for the MetaMod PHP rule, use something like:

if ($option != 'com_virtuemart') return "12,15";

You can add more modules in a comma-separated list.
You can find out those IDs by looking at the list that appears in the MetaMod. You can even see the disabled ones by clicking on "show disabled" just above the list.

The official instructions are on the Quick Start Guide page: http://www.metamodpro.com/metamod/quick-start

Maybe I shouldn't confuse the issue by suggesting a different way to do this... but here's what I would do.

Instead of including a series of module IDs like we did above, you can instead include all the modules inside a named module position.

So you could assign your two modules into a module position named "left-metamod". (hint: you can type that into the "module position" box when you edit each module). Because that position does not exist in your template, they won't show up immediately.
Then, in your Metamod, use the rule:

if ($option != 'com_virtuemart') return "left-metamod";

This then pulls in all the modules from that other position, but only when you're not viewing anything in com_virtuemart.

Last but not least, you will probably have some difficulties in your situation, with the whole left (or whatever) module position not disappearing when all its modules are hidden using this method. The reason for this is that the MetaMod is a published module in that position, even when it doesn't include any other modules. The recommended way to fix this, if you're not confident doing some complex template changes, is to purchase and install MetaMod Pro (as well as using the free MetaMod module). Among other things, MetaMod Pro causes "empty" MetaMod modules to not trigger module positions to stay expanded.

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

Re: Virtuemart, hidding module

Hey!

After lots of mistake, eveything works fine now.

Thanks a lot for your help.

big_smile

TipX
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1667
Total Polls:
6
Total Posts:
5909
Posts this week:
1
User Info:
 
Total Users:
10119
Newest User:
watytb5
Members Online:
3
Guests Online:
212


Forum Legend:

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