Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.



Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.


2 rules help me... :)

2 rules help me... :)

Hello, i try to make a rule that i want to show a module only to a some virtuemart categories and a template to some of virtuemart categories.

When i create a module in which menu i have to publish it or if this is unpublish with the rule it will be show it to the specific category that i choose in the rule? (i create a module and choose to show it to every page or to a specific page?)

I want to show a template when someone link to my site and when he link to woman clothes category(includes all virtuemart pages like product page, checkout page etc) I want to show a new website template, a template to man clothes category with a different website template and a kids clothes category with a different website template.

thanks and sorry for my english.

damian from greece.

Beginner Modder
4 Posts
Administrator has disabled public posting

Re: 2 rules help me... :)

Hi Damian,

You mentioned that you want to change templates AND modules - can I assume that you are also using MetaTemplate, or MetaTemplate Pro?

Let's look at the modules first:

1 - I call the module that you want to show, the "target module". When you set up the target module, set it to "none" menu items. Otherwise, it's going to show up on the pages that you assign it to, and MetaMod won't be able to control that.

2 - Create the MetaMod and set it to ALL pages. The PHP code we use in MetaMod will control exactly which pages it finally appears on.

3 - In the MetaMod, use a rule like this to identify which categories that module should appear on. The module will appear on browse pages and product_details pages, as long as the category is correct:

$vm = JomGenius("virtuemart");
if ($vm->check("pagetype = none of shop.browse, shop.product_details")) return;
if ($vm->check("category_id = 101, 102, 103")) return XXX;
if ($vm->check("category_id = 104, 105, 106, 107")) return YYY;
// replace the category ids (101, 102 etc) with the ones you want to check for
// replace XXX and YYY with the id number of the target module.


For this you need MetaTemplate Pro (which you have?).

Create a new rule for each template that you want to apply (e.g. one for Men's clothes, one for Women's clothes).

In each rule, simply type in the category ids of the VM categories that you want to use that template. The field is named "Category id(s)" in the VirtueMart section. If you want the template to be active for that category and all categories below it, use the "Ancestor Category id(s)" field instead.

Then in the SUCCEED action, select the template that you want to use for those categories.

I hope that helps - please write back if you need any more help with it.

Best regards,

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

3330 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
Total Topics:
Total Polls:
Total Posts:
Total Posts Today:
User Info:
Total Users:
Newest User:
Members Online:
Guests Online:

There are no members online

Forum Legend:

 New Sticky