Force template selection using PHP

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

Force template selection using PHP

Post 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

$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

So I wondered if this was possible with PHPWCMS ?
User avatar
Posts: 6446
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: Force template selection using PHP

Post 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
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Post Reply