Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Module only in category of Virtuemart
Module only in category of Virtuemart
Re: Module only in category of Virtuemart
Hi dimavricos,
take a look on this page:
http://www.metamodpro.com/metamod/recip … mart-pages
The names of the pages are slightly different on VM2.x and VM1.x.
What version of VM are you using?
Stephen
Re: Module only in category of Virtuemart
Thank you very much for the reply,
i use vm 2.06,i already have seen the link you have me, but realy i dont have any idea how to use it.I have enabled the plugin, and then should i put the code into the php option of the module?
Can you please give me a small step by step tutorial?
Thank you very much for your time
Re: Module only in category of Virtuemart
1 - set up the module that you want to display - the "target" module. Except, set it to display on "none" menu items. Take a note of the module id of this module.
2 - create a MetaMod, enable it, and set it to display on "all" pages.
3 - in the MetaMod, use the following PHP rule:
$vm = JomGenius("virtuemart");
if ($vm and $vm->check("pagetype = category")) return XXX;
// replace XXX with the module id of the target module
That should do it, placing the target module ONLY on VM category pages, not any other type of page on your site.
Best regards,
Stephen
Re: Module only in category of Virtuemart
That works perfect thank you very much,
on the other hand if i want to display a module on a specific product layout?
And and one last, is it posible to choose a diferent template in a specific product layout?
Thank you again very much
Re: Module only in category of Virtuemart
Is this what you're after?
$vm = JomGenius("virtuemart");
if ($vm and $vm->check("pagetype = category")) return XXX;
// replace XXX with the module id of the target module
if ($vm->check("pagetype startswith productdetails") and $vm->check("product_id = 100")) return YYY;
// replace YYY with the module id of the target module, appearing only for product 100
For templates, you can use "Chameleon" available on this site. This allows you to swap templates based on these sorts of criteria. There's even a GUI for it - the example above can be easily set up without PHP code.
Cheers,
Stephen
Re: Module only in category of Virtuemart
Hi dimavricos,
if you're using Joomla 1.5, then the Lite version will be fine and you can use PHP rules like the one above. The main difference is that instead of returning a module ID, you need to return a true or false in order to make the rule succeed or fail.
e.g.
return true;
Cheers,
Stephen
Re: Module only in category of Virtuemart
- Index
- » MetaMod
- » MetaMod General Support
- » Module only in category of Virtuemart
Board Info
- Board Stats:
- Total Topics:
- 1699
- Total Polls:
- 6
- Total Posts:
- 5967
- Total Posts Today:
- 2
- User Info:
- Total Users:
- 8027
- Newest User:
- henley7346
- Members Online:
- 1
- Guests Online:
- 202
- Online:
- henley7346
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked