Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » To disable modules on some pages...
To disable modules on some pages Virutemart
To disable modules on some pages Virutemart
hi guys,
Unfortunately I can not run the module as I would like.
I wish that the modules 70 and 71 (left position), see in all the pages of the site, except in the pages of virtuemart shop.cart and checkout.
I put this code but the modules can be seen in every page of the site:
if ($page != "checkout.index" && $last_step == "" ) return 70;
if ($page != "checkout.index" && $last_step == "" ) return 71;
if ($page != "shop.cart") return 70;
if ($page != "shop.cart") return 71;
I hope someone can help me.
fine thanks.
Re: To disable modules on some pages Virutemart
Hi Goldlink,
it looks like you just picked some code out of the recipe for determining the VM page that you are on.
Close, but you needed to use a few other lines as well!
Basically, you need the code for generating the "$page" and "$last_step" variables. Also, if you want to return 2 different modules at the same time, you put them both together like this: return "70,71";
So try this as your code:
Code:
/* first, always return them both on any page that's not a virtuemart page */
if ($option != 'com_virtuemart') return "70,71";
/* now, since we know we're on Virtuemart, check the exact pages */
$page = JRequest::getVar('page');
/* if we're not on the cart page or any of the checkout pages, return our modules */
if ($page != "shop.cart" and $page != "checkout.index" ) return "70,71";
In this case we didn't actually need to deal with "last_step", because all pages that have the "checkout_last_step" parameter also have $page == "checkout.index", so we just check for that.
Hope that does what you want it to
Re: To disable modules on some pages Virutemart
Thanks a lot, works perfectly!
Unfortunately I had to ask for your help... I always try to find the solution in other post, but until I will not understand how metamod works, you will bear me!
Thanks again and good work.
Re: To disable modules on some pages Virutemart
Hey that's no problem. Everyone's situation is slightly different and some tweaks are often needed. That's the beauty of MetaMod... you're not forced into a "1 size fits all" setup and a rule can be made for just about any situation.
Glad it's working for you,
Cheers,
Stephen
Re: To disable modules on some pages Virutemart
Hi..
Im new to MetaMod.
Just installed it and saw a lot of options.
Dint understand any of it.
Just entered this code from above,
/* first, always return them both on any page that's not a virtuemart page */
if ($option != 'com_virtuemart') return "70,71";
/* now, since we know we're on Virtuemart, check the exact pages */
$page = JRequest::getVar('page');
/* if we're not on the cart page or any of the checkout pages, return our modules */
if ($page != "shop.cart" and $page != "checkout.index" ) return "70,71";
And placed it.
But no changed.
In place of 70,71 , I just placed my module id of 106 .
Not sure, what am I missing.
- Index
- » MetaMod
- » MetaMod General Support
- » To disable modules on some pages...
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7627
- Newest User:
- rudys68879
- Members Online:
- 0
- Guests Online:
- 160
- 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