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 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

pstelt
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

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

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

Board Info

Board Stats:
 
Total Topics:
1691
Total Polls:
6
Total Posts:
5912
Total Posts Today:
6
User Info:
 
Total Users:
11529
Newest User:
jame380003
Members Online:
1
Guests Online:
144

Online: 
jame380003

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked