Template change based on previous browser url visited

Template change based on previous browser url visited

Hello,
I don't know where I read this, but it seems it's possible to change the template based on a previous page, or previous url (in my specific case)
Could you confirm ? Could you also help me for setuping this rule ?
It might be based on http referer ? (but as far has I get it it seems not very stable solution...)
Maybe with a cookie so ?

Re: Template change based on previous browser url visited

yes, you could do it based on referrer. That's pretty reliable (although it can be spoofed) as long as you want to detect exactly the previous page before the current page.

i.e. if you want to detect that someone has visited a certain page/url at any time in the current session, then you are right, you need cookies or a session variable.

So I will assume that that is what you want, to detect that a person has visited a certain URL on your site, and remember this for the rest of the session.

Rule 1: detect the URL. For the action, "set session variable A", then continue to next rule in chain.
Rule 2: detect session variable A. If found, in the succeed action, set the required template.

That way, as soon as someone visits the page in question, this sets the session variable. Then rule 2 can pick that up and will set the template every time a page is requested and that session variable is found.

Best regards,
Stephen

Stephen BrandonMetaMod / Chameleon developerIf you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod