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.

 

Hide left column of VM Flypage & Cart

Hide left column of VM Flypage & Cart

I was recommended MetaModPro just a few moments ago via the VM Forum but I actually do not know if this is the right way for my problem.

I simply want to hide the complete left column of the template on the product page and the cart page, while on all other pages like in the categories the left column will still be present and hold the desired modules.

Actually I understand what MetaModPro can do but do not know if this is what I need to do? Actually I think I only miss that certain code that allows to disable the left column on certain pages but in the VM and the Joomla Forum I got no way to achieve this.

Any suggestions? Thanks upfront!

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

Re: Hide left column of VM Flypage & Cart

Hi IntraX,

If you're into template programming then it would be possible to put some PHP code into the template which completely removes the left column on certain pages. That would be a good solution.

MetaMod Pro makes a good solution too though. Using MetaMod (+ Pro) you can simply tell the modules that are in the left column to UNpublish whenever you are on certain pages.

MetaMod Pro allows you to alter the parameters of any module that's showing on the current page - including turning it off altogether.

So as long as you have MM Pro installed, you can create a new MetaMod in any position on the page, and use the following code:

$vm = JomGenius("virtuemart");
if ( $vm->check("pagetype = shop.product_details, shop.cart") ) {
  $changes->mod( XXX )->disable();
  $changes->mod( YYY )->disable();
  $changes->mod( ZZZ )->disable();
   // add more as necessary
}

Replace XXX-ZZZ with the module IDs that you want to unpublish on the product details and shop cart pages.


The MetaMod itself isn't going to show up, as you are not actually including any other modules inside it. But the PHP code inside it will get run, and this will disable those other modules.

Hope that helps,
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
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Hide left column of VM Flypage & Cart

Hello Stephen and thanks for the detailed answer.

Okay, I understand what I can do, and I think I also have a direct use for MetaModPro. So I can basically choose to display only certain modules on the cart page for example, like a menu with notes to shipping or other services while those won't be displayed anywhere else.

Is there a guide included in MetaModPro, so that I actually know how the codes have to be structured as I looked over the forum and there are many tips and recipes but is there also a basic guide for working with MetaModPro?

Thanks again for the clarifying answer!

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

Re: Hide left column of VM Flypage & Cart

Hi IntraX,

Basically there are very few differences between what you can do with MetaMod, and when you use MetaMod Pro on top of MetaMod. This particular case highlights the one big usage difference: MetaMod Pro allows you to disable modules that are elsewhere on the page. Normally, MetaMod (without the Pro plugin installed) doesn't have access to other modules on the page.

This difference is explained on the Module Param Control page.

The most common reason people purchase the Pro plugin is not something you have to learn or configure - it "just happens" automagically. This is regarding how the included modules are put onto the page, and is explained on the MetaMod Pro page.

Documentation for these products is a moving target. I've just been working on a large number of updates to the "recipes" pages, which take you through many common (and some obscure) use cases. These are worth browsing to get an idea of how to approach different situations.

If you're using a component that's not covered in the Recipes section, then the MetaMod Advanced Debug mode can often get you started in designing a rule to detect particular pages / sub-pages.

Last but not least (in fact it should be your first step!) is the Quick Start guide. This covers the basics and should be required reading smile

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

Re: Hide left column of VM Flypage & Cart

Hello again and thanks for infos. Basically I will in any case need the Pro version as I read that otherwise "reserved" module space would still be shown and the problem with "no left column" on product page would not work.

So I will get the Pro version the next days, probably see you back in the forum with more questions soon:)

Thanks again for the great pre-sales support!

P.S.: You may indeed thank the mods in the VM Forum, they recommended MetaModPro to me;)

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

Re: Hide left column of VM Flypage & Cart

Okay, I could get it work with the code above to NOT show on products details and cart page. Now is there a recipe to turn this around and show ONLY on the pages added to the code...?

I tried this code but it does not work:

$vm = JomGenius("virtuemart");
if ( $vm->check("pagetype = shop.browse") ) {
  $changes->mod( 190 )->enable();
   // add more as necessary
}

Is there a way vise versa or do I have to add any VM page to the code as shown a few posts above?

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

Re: Hide left column of VM Flypage & Cart

Hi IntraX,

at this time, you can't use enable() to pull in extra modules. But you can do it using the normal "return" mechanism:

$vm = JomGenius("virtuemart");
if ( $vm->check("pagetype = shop.browse") ) {
  return 190;
}

If you want to return more than one:

$vm = JomGenius("virtuemart");
if ( $vm->check("pagetype = shop.browse") ) {
  return "190, 191, 192";
}

If you want to put the modules on more than one type of page:

$vm = JomGenius("virtuemart");
if ( $vm->check("pagetype = shop.browse, shop.product_details") ) {
  return "190, 191, 192";
}


Hope that helps,
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
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Hide left column of VM Flypage & Cart

That helps indeed, thank you for the very quick and satisfying reply! It is indeed a little "genius" this module and plugin smile

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

Re: Hide left column of VM Flypage & Cart

But actually it does not work this way, the module is still shown also on other pages. There is also some problem with the checkout.index in VirtueMart, I tried this code:

$vm = JomGenius("virtuemart");
if ( $vm->check("pagetype = shop.product_details, shop.cart, a-few-more, checkout.index") ) {
  $changes->mod( XXX )->disable();
  $changes->mod( YYY )->disable();
  $changes->mod( ZZZ )->disable();
   // add more as necessary
}

But it is not disabled on the checkout pages??? Any idea why this is so?

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

Re: Hide left column of VM Flypage & Cart

1 - If you're using the "return" technique to include modules, have you remembered to "disable" the target modules so that they don't show up unless MetaMod includes them?
2 - when you're using any PHP code in MetaMod like this, ensure that you are NOT including any module IDs in the "Quick module ID include" box. There should be nothing in there.
3 - using either technique ("return" or "disable"), you need to ensure that your MetaMod is assigned to the right pages. For the "disable" method, you should assign the MetaMod to ALL pages. That's because the checkout pages may look to Joomla as if they are on the front page (it's a sort of VM/Joomla bug), so if you just assigned the MetaMod to the VM menu item it might miss those pages. (therefore it doesn't disable the modules on the checkout pages).
4 - Actually, the problem is probably this: don't forget that each of the checkout pages has its own name in JomGenius:

checkout.index#1, checkout.index#2, checkout.index#3, checkout.index#4

This is so that you can target them each individually. So you probably need to list these all in the JomGenius command.


Hope one of those will help,
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
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
3
User Info:
 
Total Users:
4397
Newest User:
tull687318
Members Online:
0
Guests Online:
130

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