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 different Modules with PHP on same Url

Show different Modules with PHP on same Url

hello stephan,, i tried in metamode php the following code to show ID 530 only for Urls with Parameter hide and if no hide in Url the ID 375 but i guess something is wrong. could you please help me?

Code:

if ( JRequest::getVar( 'hide' ) == null) return 530; else return 375;

testcouch
Beginner Modder
ranks
useravatar
Offline
13 Posts
Administrator has disabled public posting

Re: Show different Modules with PHP on same Url

Hi testcouch,

what appears to be going wrong? Do you always get module 530, or always 375, or are you getting them reversed (530 when it should be 375, and 375 when it should be 530)?

The way you described it, you want 530 if the parameter "hide" is present in the URL. So perhaps it should be the other way around:

if ( JRequest::getVar( 'hide' ) == null) return 375; else return 530;

I *think* that testing for null will detect when the parameter is not present, but it probably also tests for when it is present but blank, like this:  www.example.com/index.php?hide or www.example.com/index.php?hide=

Exactly which one do you need to detect? e.g. hide or hide= or hide=1 etc?

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

Re: Show different Modules with PHP on same Url

many thanks stephen for your quick response..i should it explain a bit better what i try to achieve wink

i want to show Module ID 530 only on Joomgallery category and detail Url:
1. index.php?option=com_joomgallery&Itemid=112&catid=193&lang=de&view=category
2. index.php?option=com_joomgallery&Itemid=112&id=931&lang=de&view=detail

and on all other Joomgallery Urls (index.php?option=com_joomgallery&Itemid=112..) Module ID 375


Code:

if (

$option == 'com_joomgallery'
and $view == 'category'
and $jinput->get('catid') == '193' /*!*/
and $Itemid == '112'
and $jinput->get('limit') == '20' /*!*/
and $jinput->get('limitstart') == '0' /*!*/
and $jinput->get('catlimitstart') == '0' /*!*/
and $jinput->get('lang') == 'de' /*!*/
) return XXX; /* Ersetzen Sie XXX mit der Modul-ID oder Modul-Anzeigeposition */

testcouch
Beginner Modder
ranks
useravatar
Offline
13 Posts
Administrator has disabled public posting

Re: Show different Modules with PHP on same Url

ok i think your tipp here http://www.metamodpro.com/forums/topic?id=484#p7294 helps me better, because the com_joomgallery Detail Image url does not contain the respective category catid=193 so it is better for me i use the exact name from SEF Url. thanks stephen

testcouch
Beginner Modder
ranks
useravatar
Offline
13 Posts
Administrator has disabled public posting

Re: Show different Modules with PHP on same Url

Ok, that's good. I'm glad you've got a working setup now. MetaMod is very flexible and able to detect most types of pages, with a little effort sometimes smile

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

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10783
Newest User:
weatti4qx
Members Online:
0
Guests Online:
259

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