Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Change template through GET arguments...
Change template through GET arguments and session variables.
Re: Change template through GET arguments and session variables.
Hi k84pd5,
sure - this is easy to do.
You'll make a rule that detects the GET parameter, and returns "true" from the PHP code.
Then, for the SUCCEED action you'll set the desired template, and set the cookie.
In the second rule you will detect the cookie, and use that to set the template in the SUCCEED rule.
FIRST RULE:
In the PHP box:
if (JRequest::getVar("testme") == "1") return true;
... then in the SUCCEED action, set the desired template, and "Set Session Variable A".
SECOND RULE:
In the "Quick Rules" near the top of the page, set "Detect Cookie/Session variable" to "Session Variable A"
... don't put anything in the PHP box
... select the desired template in the SUCCEED action.
TO USE:
enter your site with http://example.com/mypage?testme=1
The new template should be used for the rest of the session.
p.s. this is done exactly the same in MetaTemplate and MetaTemplate Pro.
Re: Change template through GET arguments and session variables.
Hi there,
I have found this extremely helpful, but would like to extend this to enable them to switch to another template
Eg if they selected a link that said:
http://example.com/mypage?testme=2
If they haven't selected the link http://example.com/mypage?testme=2 and are using pages that just have no reference to ?testme= eg http://example.com/mypagelink2 then I want them to continue using the template 1 until the move to 2.
Does this make sense?
Re: Change template through GET arguments and session variables.
Hi annamations,
I just replied to your other post, which I think answers this question.
http://www.metamodpro.com/forums/topic?id=666
Cheers,
Stephen
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Change template through GET arguments...
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7633
- Newest User:
- mingle7855
- Members Online:
- 0
- Guests Online:
- 104
- 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