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.

 

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

goltoof
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: show module only in specified sef url

..

goltoof
Beginner Modder
ranks
useravatar
Offline
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:

index.php?option=com_contact&view=category&catid=12&Itemid=133

and an individual item page:

index.php?option=com_contact&view=contact&id=1%3Aname.html&catid=12%3Acontacts&Itemid=133

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

index.php?option=com_contact&view=contact&id=2&Itemid=61

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

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

Board Info

Board Stats:
 
Total Topics:
1698
Total Polls:
6
Total Posts:
5944
Posts this week:
4
User Info:
 
Total Users:
5543
Newest User:
aj88
Members Online:
0
Guests Online:
119

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