Log in

View Full Version : Using Different CSS templates



Seandudding
05-19-2008, 09:02 AM
Could someone let me know if this is possible.

I want to use a different css file depending on the inbound url.

If the incoming link is http://xxxx.xxx/?source=awin I want it to use one template and then a different one for everyone else.

Is this possible?????

Thanks Sean

Medyman
05-19-2008, 01:20 PM
Sure...

What language are you using to produce or, more importantly, read those URI segments? PHP? JavaScript?

shotgun_ninja
05-19-2008, 03:06 PM
In either case, you could just have your scripts (Javascript/PHP/etc.) echo the stylesheet link into the header based on request or global variables.

Say, in PHP, the code might look like this: (Although I'm a little iffy on PHP URI's, correct me if I'm wrong plx)



<!-- .... -->
<head>
<link rel="stylesheet" type="text/css" src=<?php
if (isset($_REQUEST['source']) && ($_REQUEST['source'] == "awin")) {
echo("\"styles/alternate.css\");
} else {
echo("\"styles/regular.css\");
}
?> />
<!-- .... -->