Page 1 of 1

Force template selection using PHP

Posted: Tue 27. Jul 2010, 21:20
by Peekay
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 ?

Re: Force template selection using PHP

Posted: Mon 9. Aug 2010, 17:18
by update
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