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.

 

want module to display only on VM hompage only

want module to display only on VM hompage only

Hi, I'm a newbie with 0 experience with php: I'm using virtuemart 2.6 and am not able to get a product display module (DJ media tools) to show only in position 15 (the top body section) of the Atomic template, on the VM store homepage. At the moment it appears in the right position - but on every VM page. I searched around the forum but didn't find any scripts that worked for me.

I tried this wthout success:
$vm = JomGenius("virtuemart"); // need this at the start of every rule
if ( $vm->check( "pagetype = frontpage" ) ) return 112;

I also have the media tools album "unpublished" but it still appears on every VM page...

In this case, I have VM installed in a subdirectory, so my website homepage is not the same as the VM store homepage (if that makes a difference)....

tap21
Junior Modder
ranks
useravatar
Offline
20 Posts
Administrator has disabled public posting

Re: want module to display only on VM hompage only

...I also tried the advance debugger to use the suggested php script - but this also doesn't limit the display to only the store homepage (the module still appears on all VM pages):

if (
$option == 'com_virtuemart'
and $view == 'virtuemart'
) return 112;

Any suggestions??

tap21
Junior Modder
ranks
useravatar
Offline
20 Posts
Administrator has disabled public posting

Re: want module to display only on VM hompage only

SOLVED:

the solution was simple but not intuitive: if you enter the module number into the "basic options" sub menu in the control panel - it seems that module will be displayed 'everywhere'.

If you want to limit its appearance DON'T enter anything in the "quick module position or id" field, and use only the php script to direct it to a specific location, like the VM store homepage (below):

if (
$option == 'com_virtuemart'
and $view == 'virtuemart'
) return XXX; /*XXX is your module number*/

tap21
Junior Modder
ranks
useravatar
Offline
20 Posts
Administrator has disabled public posting

Re: want module to display only on VM hompage only

Hi tap21,

yes, if you enter a module id into the "quick module id or position include" box, it will appear on most or all pages that the MetaMod is assigned to. The only exceptions are if you are using the date/time boxes or the logged-in/guest selectors, in which case the module will only be displayed if those conditions are met.

In general, if you are using PHP rules you should leave the "quick module id or position include" box empty.

Regarding the VM home page: I'll test this again as I think this should have detected the VM home page correctly. It's possible that a more recent update of VM broke it. Ill check it with VM2.6.

Thanks,
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:
5543
Newest User:
aj88
Members Online:
0
Guests Online:
121

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