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.

 

Module only in category of Virtuemart

Module only in category of Virtuemart

Hi, can you please tell me how can i show a module only in category layout and not in product layout?

dimavricos
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

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

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

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

dimavricos
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

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

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

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

dimavricos
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

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

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

Re: Module only in category of Virtuemart

I just want to have a different template in categories than in product layout.Should i buy chameleon or the lite version is ok?
Thank you

dimavricos
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

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

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

Re: Module only in category of Virtuemart

If i use 2,5, i should buy it?

dimavricos
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: Module only in category of Virtuemart

Sorry there's no Lite version for Joomla 2.5 - yes, you need to purchase the full version.

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

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10796
Newest User:
mokao3
Members Online:
0
Guests Online:
190

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