Force template selection using PHP

post everything related to phpwcms templates here

Force template selection using PHP

Postby Peekay » Tue Jul 27, 2010 21:20

Can I overide the template that is allocated to each section of the site structure by using raw PHP?

For example, say I added a script that detected the Opera browser. Could I then change the homepage template from 'example_template' to 'opera_template' using a conditional statement like:

Code: Select all
if($isOpera){
$template = 'opera_template'
}


(I know those variables don't really exist)

I use another CMS where the theme can be set in a link if required, e.g.

Code: Select all
index.php?theme=opera_theme


So I wondered if this was possible with PHPWCMS ?
Peekay
 
Posts: 286
Joined: Sun Jul 25, 2004 23:24
Location: UK

Re: Force template selection using PHP

Postby claus » Mon Aug 09, 2010 17:18

Simply no, I think. But you can let the browser select "his/her" CSS via conditional comments. Because it's only a question of choosing the appropriate style sheet it will be simple to achieve your goal
The following (and the previous) wouldn't have happened if there had been a GURM!
update process in progress 99.9% - Please stand by.. don't hit any key. Hold your breath ... until the day when pigs can fly ...
update: seems so as if pigs just start learning how to fly... processing around 99,95%
User avatar
claus
 
Posts: 3467
Joined: Mon Jan 10, 2005 18:29
Location: germany / outdoor


Return to phpwcms Templates English

Who is online

Users browsing this forum: No registered users and 1 guest