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.

 

Virtuemart Front Page problem

Virtuemart Front Page problem

Well on the surface of it MetaMod looks like the solution to the problems I've been having with Joomla/Virtuemart, so hoping I'm just missing something obvious.

I have a Virtuemart page on the homepage of my site.  I want to have three 'info box' modules displayed across the bottom of the page, before the footer, and nowhere else on the site.  Nothing complicated, or so I thought.

I installed MetaMod, following the instructions, and used the simple code for making a module display only on the front page, i.e. if ($option == "com_virtuemart" and JRequest::getVar("page") == null) return 101;, changing '101' to '38' in my case.

I checked all the quick start stuff on setting up the module correctly, but so far it stubbornly refuses to display on the homepage, and debug returns the following,

$option: com_virtuemart
$view:
$id:
$Itemid: 1
$timezone: default
$language: en-gb
$language_code: en
$language_region: gb
Including modules:


I take it 'Including modules:' should not be blank?  Any help on this would be greatly appreciated.

iskye81
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: Virtuemart Front Page problem

Hi iskye81,

can you turn on Advanced Debugging and post the results of that on here? You're right, "Including Modules" should not be blank, and this implies that JRequest::getVar("page") is pulling something out other than null. Advanced Debugging should tell us what that is.

Sorry it didn't work first time...

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: Virtuemart Front Page problem

Hi Stephen,
Thanks for getting back to be.  Here's the output from advanced debug...

if (
$option == 'com_virtuemart'
and $Itemid == '1'
) return XXX; /* replace XXX with the module ID or position to display */
MetaMod debug info:
$option: com_virtuemart
$view:
$id:
$Itemid: 1
$timezone: default
$language: en-gb
$language_code: en
$language_region: gb
Including modules:

iskye81
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: Virtuemart Front Page problem

That's very odd, if your rule wasn't working. $option seems to be correct, the 'page' option seems to be correct, I wonder what's going on?

Here's one variant to try:

if (JRequest::getVar('option') == "com_virtuemart" and JRequest::getVar("page") == null) return 38;

Here's another, which should just give you a bit of debug feedback:

echo "option = '" . $option . "' and page = '" . JRequest::getVar("page") . "'.<br>";
if ($option == 'com_virtuemart' and JRequest::getVar("page") == null) echo "Matched it!";
else echo "for some reason, did not match";
// we'll just return it at the end by default, to make sure the inclusion mechanism is working.
// if this does not include the module, then something else is wrong!
return 38;

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: Virtuemart Front Page problem

Here's the debug info I get this time,

if (
$option == 'com_virtuemart'
and $Itemid == '1'
) return XXX; /* replace XXX with the module ID or position to display */
MetaMod debug info:
$option: com_virtuemart
$view:
$id:
$Itemid: 1
$timezone: default
$language: en-gb
$language_code: en
$language_region: gb
option = 'com_virtuemart' and page = 'shop.index'.
for some reason, did not matchIncluding modules: 38

This makes the module appear, but on every page, as without MetaMod.  Basically seems to be every page or none!

iskye81
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: Virtuemart Front Page problem

Yes, this was just a test of inclusion, to make sure that that part was working. We'll remove that this time.

This is a very interesting situation, and illustrates a bit of a bug in the advanced debug mode. It also shows how to fix it in your case though:

if ($option == "com_virtuemart" and JRequest::getVar("page") == "shop.index") return 38;

I think that's finally going to work smile

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: Virtuemart Front Page problem

Terrific Stephen, that seems to be working now.

many thanks,
Iain

iskye81
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: Virtuemart Front Page problem

Hello,

I am having the same issue. I tried to follow along in this thread to see if there was something I could learn or apply to my page, but I`m still not getting it. I only want the mod to appear on my VirtueMart homepage, but am unfortunately having it applied to each page of VirtueMart in my website.

Here`s the debug code that I`m getting:

Advanced:

if (
$option == 'com_content'
and $view == 'article'
and $id == '27'
and $Itemid == '30'
) return XXX; /* replace XXX with the module ID or position to display */

MetaMod debug info:

$option: com_content
$view: article
$id: 27
$Itemid: 30
$timezone: default
$language: en-us
$language_code: en
$language_region: us
Including modules: 52

And this is the page (the only one) that I want the mod applied to:

http://nhltopshelf.com/DerekAlexander/J … ;Itemid=30

Thank you in advance for your assistance and I want to say thank you for such a great product.

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

Re: Virtuemart Front Page problem

Hi StealthOiler,

from the setup of your site, it looks like the front page of VM is quite distinct from all the other VM pages, in that the front page is a content article (com_content), and the other VM pages are com_virtuemart.

Therefore, the rule above should work fine, and exclude the module from the VM pages... as long as the module is not showing up of its own accord on those other pages.

What to look for is this:
- is your "target" module set to "disabled" or in some other way prevented from showing up on pages unless the MetaMod includes it?

If that's not the problem, get back to me and I'll keep looking.

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: Virtuemart Front Page problem

Thanks for your reply.

I checked it over and the mod is not disabled.

What I can do is try including it on another page (in this case, a com_virtuemart page rather than a com_content page) to see if that makes a difference. I'll post my findings back here.

Thanks again,
Ryan

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

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10727
Newest User:
solza2
Members Online:
0
Guests Online:
142

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