Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.



Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.


show module only in specified sef url

show module only in specified sef url

I got a few menu items linking to list style pages, ie, category list, section list, contact lists, etc. So adding a module to the menu item of course is going to make it appear in everything in the list.

Is there a way to make metamod display a module only for a specified sef url?  For example "index.php/contact-us.html".  This way I can have a module on my contact list page that won't show up on the subsequent contact pages.

I tried the recipe to display based on keywords/content/description, but these particular pages don't have keywords and it's just not effective to display based on content or descriptions.

Perhaps the solution is something more straight forward, like displaying by item id of the menu item?  I didn't see any recipe for this though, which is why I'm asking about it here.

Edited By: goltoof
12-Feb-10 09:13:59

Beginner Modder
3 Posts
Administrator has disabled public posting

Re: show module only in specified sef url


Beginner Modder
3 Posts
Administrator has disabled public posting

Re: show module only in specified sef url

Hi goltoof,

try turning on Advanced Debug, with a MetaMod assigned onto the menu item for your Contact Us menu item.

You'll see some generated code as you go from page to page, that generally identifies the exact page that you're on, and can be used directly inside MetaMod.

It doesn't matter if SEF URLs are turned on or off, the recipes (based on URL parameters when SEF is turned off) remain the same. It' a kind of magic.

The main limitation is when you're on the main page of a component, which generally has less URL parameters than some of the sub-pages. It can't know about the URL parameters that are not there, so it doesn't know to "exclude" certain parameters...

Anyway, a non-SEF url for the category list page of contacts is like this:


and an individual item page:


or if you link to an item page from a direct menu link:


So to identify a category page:

if ( $option == "com_contact" and $view == "category" ) return XXX;

Or a particular category page:

if ( $option == "com_contact" and $view == "category" and JRequest::getInt("catid",0) == YYY ) return XXX;

Or a particular contact page:

if ( $option == "com_contact" and $view == "contact" and (int)$id == ZZZ ) return XXX;

(replace XXX with the module id to return; YYY with the category id to target, and ZZZ with the particular contact id to target).


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

3330 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
Total Topics:
Total Polls:
Total Posts:
Posts this week:
User Info:
Total Users:
Newest User:
Members Online:
Guests Online:

There are no members online

Forum Legend:

 New Sticky