Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Show module based on directory in...
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!)
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 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
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!
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
Glad it's working for you,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » Show module based on directory in...
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7628
- Newest User:
- horlogekorting34
- Members Online:
- 1
- Guests Online:
- 145
- Online:
- horlogekorting34
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked