Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Hide a module on a specific page
Hide a module on a specific page
Hide a module on a specific page
Hi,
I'm using the latest free version of Metamod on a J! 3.5.1 site.
I want to have a (cart) module removed from the page where an order is supposed to be confirmed. To achieve that, I'm using the code below:
$remove = false;
if ( $option == "com_vikrestaurants" ) {
$page = JRequest::getVar("page");
if ($page == "bestellen?task=takeawayconfirm") $remove = true;
}
if ($remove == false) return "102";
However, the module still is being displayed on that specific page. Any suggestions?
Best regards,
Paul
Re: Hide a module on a specific page
Hi Paul,
please check through the list of setup instructions on the Quick Start page:
http://www.metamodpro.com/metamod/quick-start
Specifically, it's important that the target module (102 in your case?) is set to display on "menu items: none" or set to a non-existent module position so that it does not display unless/until the MetaMod includes it.
Also I am not sure that you are using the right code to detect the page, and that's probably the problem.
JRequest::getVar("page") will search for a URL parameter called "page", perhaps something like:
example.com/index.php?page=bestellen?task=takeawayconfirm
But clearly that won't work because it has 2x "?" in it. I suspect you are trying to detect this:
example.com/bestellen?task=takeawayconfirm
Correct?
I suggest that you turn on MetaMod's "advanced debug" mode and view the page you are trying to detect. This will display some PHP code that can be used to detect that exact page. Sometimes it requires a little tweaking but generally it's pretty accurate. If you need some assistance, post the code into the forum here and I'll take a look at it for you.
Cheers,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » Hide a module on a specific page
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:
- 161
- 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