Force template selection using PHP

post everything related to phpwcms templates here
Post Reply
Peekay
Posts: 286
Joined: Sun 25. Jul 2004, 23:24
Location: UK

Force template selection using PHP

Post by Peekay » Tue 27. Jul 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 ?

User avatar
update
Moderator
Posts: 6359
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: Force template selection using PHP

Post by update » Mon 9. Aug 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
It's mostly all about webdesign, logo design, new and old pages refresh, print BUT slowly switching to be supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.

Post Reply