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.

 

How to make a module appear ONLY on a particular URL/s

How to make a module appear ONLY on a particular URL/s

Hello again,

I am using this on Joomla 2.5 and I would like certain modules to appear ONLY on certain page urls ( SEF or Non SEF ) -

Here is one of the urls

index.php?option=com_sobipro&sid=54&Itemid=266&lang=en

Please help. Thanx in advance

Edited By: sydawn
25-Aug-12 23:15:37

sydawn
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: How to make a module appear ONLY on a particular URL/s

Hi,

you can do this in 2 ways. Either by the exact URL requested (which means that if you turn on SEF then you need to alter the rule), or by URL parameters which works exactly the same whether you have SEF on or off.

1 - use this PHP:

if ($core_genius->check("url ends with index.php?option=com_sobipro&sid=54&Itemid=266&lang=en")) return XXX;
// replace XXX with module id of module to display on that URL

2 - use this PHP:

if ($option == "com_sobipro"
  and $Itemid == 266
  and JRequest::getVar("sid") == 54
  and JRequest::getVar("lang") == "en"
) return XXX;
// replace XXX with module id of module to display on that page.
// Will stay the same whether on SEF or non-SEF URLs.

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

Re: How to make a module appear ONLY on a particular URL/s

Hi there,

Been away for a long while. Ok I saw your answer and tried the second option which works BUT it give a huge blank area on the pages it does not appear ( where is should be ) and it also pushes the module to the right and off the template. How can I fix this?

sydawn
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: How to make a module appear ONLY on a particular URL/s

Hi

these are FAQs:

http://www.metamodpro.com/metamod/faq/2 … etamod-was
http://www.metamodpro.com/metamod/faq/2 … th-matamod

The easiest way to fix it is to use MetaMod Pro. But you may be able to fix the issues simply by using a module class suffix in your MetaMod, and/or changing the "style for included modules". So try those techniques first. Their success depends on the CSS and HTML of your template.

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

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
3
User Info:
 
Total Users:
4401
Newest User:
jason59312
Members Online:
0
Guests Online:
128

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