Hi
Anyone know how easy it is to show a template based on what backlink the viewer came from?
Cheers
-
☆ A M B ☆
- 24,524 Posts
Would need a template changing plugin. See the "template switcher" plugin; you could modify that code easily enough.
Is it possible to put the templates in two Snippets and use the "swapChunkonReferer"-snippet in the (real) template to choose which chunk to display?
"Would need a template changing plugin. See the "template switcher" plugin; you could modify that code easily enough."
Any ides on how to modify the teplate pugin to acheive this?
-
☆ A M B ☆
- 24,524 Posts
Instead of selecting the template depending on the $_GET value, have it depend on the HTTP_REFERER (at least I presume that’s what you mean by a "backlink"). Use a switch statement if there are certain templates you want for certain "referers", with the default for all the others.
I am still a little confused a how to acheive this as i am not the greatest when it comes to PHP.
Also! as i understand it, using http_referer is a little unstable as not all browsers will send this information.
The reason i want to do this is because i have someone who wants to use the content of my site with but with his template and contact details, and i dont want to duplicate the content!!
you could always put your content in chunks to resolve that issue...
The problem from sniffing for referrer is that if someone comes to the page from another place, say a bookmark later or they click away then go back is that they are likely to get your template again. You would have to set a cookie based on their first access or something along those lines. Gets kinda messy. I would just put your content in chunks...
"Regret for the things we did can be tempered by time; it is regret for the things we did not do that is inconsolable."
-- Sydney Harris