Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Virtuemart, hidding module
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
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
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.
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
- Index
- » MetaMod
- » MetaMod General Support
- » Virtuemart, hidding module
Board Info
- Board Stats:
- Total Topics:
- 1699
- Total Polls:
- 6
- Total Posts:
- 5967
- Total Posts Today:
- 2
- User Info:
- Total Users:
- 8028
- Newest User:
- musial8334
- Members Online:
- 0
- Guests Online:
- 162
- 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