Results 1 to 3 of 3

Thread: Using Different CSS templates

  1. #1
    Join Date
    May 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Using Different CSS templates

    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

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Sure...

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

  3. #3
    Join Date
    May 2008
    Posts
    17
    Thanks
    1
    Thanked 4 Times in 4 Posts

    Default

    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)

    Code:
    <!-- .... -->
    <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\");
    }
    ?> />
    <!-- .... -->

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •