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 based on directory in URL? (SEF URLs)

Show module based on directory in URL? (SEF URLs)

Hello,

Thank you for a great mod! I think it will be the answer to some of my prayers. :-) If only I could get it to show a module only when a particular directory is present in the URL, that is. With search-engine friendly URLs enabled, using php statements based on $view and such just don't work, at least not with my knowledge base. Is there a way I can write a php recipe that will show the selected module only if the directory "item" appears in the URL? Right now I'm close, but I have an empty module showing in places where I don't want it.

Thank you in advance for your help, and thanks again for a great module! (SO should be part of the core!)

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

Re: Show module based on directory in URL? (SEF URLs)

Hi GAskygirl,

the miracle is that $option, $view, $id, and JRequest::getVar("parameter_name") still all work when SEF URLs are enabled smile It's part of the magic of Joomla.

If you turn on Advanced Debug mode then view a page with the MetaMod enabled, you'll even get shown a snippet of PHP which uses these variables and can help you to identify the current page.

I would recommend that you try to use these variables along with many of the "recipes" shown on this site, instead of trying to use part of the rewritten URL. The advantage of doing it this way is that you can then change your friendly URLs, or temporarily turn off SEF URLs, and your rules will continue to work.

With regard to empty modules: see the FAQ section for info on what to do about them.

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

Re: Show module based on directory in URL? (SEF URLs)

Hi Stephen,

Thanks for the immediate reply! :-) Got it sorted now. Custom content management component makes the view "items" rather than "article" when viewing articles via categories, which I now see with SEF URLs off. :-)

Will experiment with the various empty module filler ideas. Thank you so much!

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

Re: Show module based on directory in URL? (SEF URLs)

I hope that advanced debug mode would also have shown you the change from article to items for the "view" variable... I built that because I was sick of having to turn off SEF URLs all the time just in order to view the raw URL smile

Glad it's working for you,
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:
1685
Total Polls:
6
Total Posts:
5912
Total Posts Today:
4
User Info:
 
Total Users:
11504
Newest User:
toko solo
Members Online:
0
Guests Online:
71

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