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.

 

[solved] Showing module ONLY in product detail pages

[solved] Showing module ONLY in product detail pages

Hello,

I'm trying to use MetaMod to show a module for a specific product detail page.
I tried using the following code:

$vm = JomGenius("virtuemart"); // need this at the start of every rule
if ($vm->check( "pagetype = productdetails" ) ) {

$product_id = $vm->info( "product_id" );

  /* modules that should appear for specific products */
  if ($product_id == "16") return 140;
  if ($product_id == "18") return 140;
}

My problem is, that the module shows up now on all pages, but I want a module to be shown ONLY for the those specific product detail pages with the product_id's 16 and 18 and not in other pages.

Is there a mistake in my code?

I think that I set up everything else correctly, so I have no idea, what the problem could be..

I'm using the Module for Joomla 2.5 for VM 2.

Thanks in advance!

Christos

Edited By: metamodguy
29-May-13 21:46:38

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

Re: [solved] Showing module ONLY in product detail pages

Hi,

ensure:
1 - that the target module (140) is assigned to menu items: none, or is set to a module position that does not exist. Otherwise it will show up on every page regardless of MetaMod.
2 - that you don't have anything in the "quick module id or position include" box. Leave it blank.
3 - that the MetaMod is published and set to a valid module position, and some or all pages (menu items) on your site.

Does that help?

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

Re: [solved] Showing module ONLY in product detail pages

Hi,

thanks for your quick answer.
The "quick module id or position include" box was not blank so I deleted what I typed in there. First of all thanks for this. smile The rest was ok.

Now the module is shown only in the defined pages, but there is now a problem with the module's title. The module itself doesn't show up anymore, but the module title still remains on every page.

I tried switching around on/off the titles in both modules, deleting cache, but
no success.

Any idea?

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

Re: [solved] Showing module ONLY in product detail pages

Hi,

I just bought the pro version. Now it works. Thanks! smile
I love your module!

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

Re: [solved] Showing module ONLY in product detail pages

Great, glad it's working for you. Thanks for the feedback.

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

Board Info

Board Stats:
 
Total Topics:
1698
Total Polls:
6
Total Posts:
5944
Posts this week:
4
User Info:
 
Total Users:
5534
Newest User:
kaylee
Members Online:
0
Guests Online:
167

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