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.

 

subdomain issue

subdomain issue

my need :

each visitor coming from one of my subdomain have a different template :

ex: xxx.mydomain.com  template 1
yyy.mydomain.com = template 2

each subdomain have an automatic redirecting page to my general website : www.mydomaine.com/index?template=template1 (for template 1 )

how cani make with metamod pro to make thatall visitor coming from one of my subdomain always keep its attribuated template ??

Thanks in advance

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

Re: subdomain issue

Hi omaze,

I moved this to the MetaTemplate Pro forum (it was in the MetaMod forum but I assume that when you said "metamod pro" above, you meant MetaTemplate Pro).

I would do it this way:

1 - make a new MetaTemplate rule for each of the 2 templates

2 - in the 1st rule, use the following PHP:

if ( JRequest::getVar( 'template' ) == 'template1' ) return true;

3 - then in the SUCCEED action for that rule, use the dropdown to set the template that you want to use, and ALSO use the dropdown to select "Set session variable A".

4 - repeat 2-3 for the other template, setting session variable B for template2.

5 - now make another rule. In this rule, use the dropdown "Detect Cookie/Session variable" and set it to "Session variable A". This rule is used for detecting repeat visits in the same session, even when "template=template1" does not appear in the URL.

6 - in the new rule, in the SUCCEED action, use the dropdown to set the 1st template.

7 - repeat 5-6 with a new rule, detecting Session variable B, and setting the second template.


Here's how it works:
- in rule 1, you detect "template=template1" in the URL. You use this to immediately set the new template, and also to set a session variable (A) to remember that you already received "template=template1".
- in rule 2, you do the same for template=template2, and set session variable B.
- in rule 3, you check to see if session variable A was already set (i.e. the 1st rule had succeeded earlier in the session). If so, you set template 1.
- in rule 4, you check to see if session variable B was already set (i.e. the 2nd rule had succeeded earlier in the session). If so, you set template 2.

Hope that helps,
Best regards,
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
3312 Posts
User info in posts
Administrator has disabled public posting

Re: subdomain issue

Hi,

its works perfectly...

Thank you for your help.

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

Board Info

Board Stats:
 
Total Topics:
1666
Total Polls:
6
Total Posts:
5909
Dormant:
User Info:
 
Total Users:
10091
Newest User:
lamanaudio
Members Online:
3
Guests Online:
207


Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked