Results 1 to 4 of 4

Thread: help with Style Switcher driven by XML

  1. #1
    Join Date
    Oct 2006
    Location
    London
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default help with Style Switcher driven by XML

    I have sucessfully implemented a style swither on my site using the one at http://www.dynamicdrive.com/dynamic...eetswitcher.htm

    Now the problem i have with this is that it requires putting the various diffrent alternative style links in the head of every page of my site. So whenever i create a new style sheet I will have to go through every page and add the link to the new css. This also applies if I want to remove a one. At the moment the head of each page looks like this:

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Irishmark.net</title>


    <link rel="stylesheet" type="text/css" href="http://www.mediachill.com/irishmark/Layouts/Default.css" title="Default" />
    <link rel="alternate stylesheet" type="text/css" href="http://www.mediachill.com/irishmark/Layouts/BedLamp.css" title="BedLamp.css" />
    <link rel="alternate stylesheet" type="text/css" href="http://www.mediachill.com/irishmark/Layouts/BlueBubbles.css" title="BlueBubbles.css" />
    <link rel="alternate stylesheet" type="text/css" href="http://www.mediachill.com/irishmark/Layouts/Carolyn_1.css" title="Carolyn_1.css" />
    <link rel="alternate stylesheet" type="text/css" href="http://www.mediachill.com/irishmark/Layouts/Dad.css" title="Dad.css" />
    <link rel="alternate stylesheet" type="text/css" href="http://www.mediachill.com/irishmark/Layouts/Interview.css" title="Interview.css" />
    <link rel="alternate stylesheet" type="text/css" href="http://www.mediachill.com/irishmark/Layouts/Lucy.css" title="Lucy.css" />
    <link rel="alternate stylesheet" type="text/css" href="http://www.mediachill.com/irishmark/Layouts/RedAceSpades.css" title="RedAceSpades.css" />
    <link rel="alternate stylesheet" type="text/css" href="http://www.mediachill.com/irishmark/Layouts/Scribbles.css" title="Scribbles.css" />
    <link rel="alternate stylesheet" type="text/css" href="http://www.mediachill.com/irishmark/Layouts/Spider.css" title="Spider.css" />
    <link rel="alternate stylesheet" type="text/css" href="http://www.mediachill.com/irishmark/Layouts/WhiteBlood.css" title="WhiteBlood.css" />
    <link rel="alternate stylesheet" type="text/css" href="http://www.mediachill.com/irishmark/Layouts/WhiteGrundge.css" title="WhiteGrundge.css" />
    <link rel="alternate stylesheet" type="text/css" href="http://www.mediachill.com/irishmark/Layouts/DullBasic.css" title="DullBasic" />

    <script src="styleswitch.js" type="text/javascript">
    </script>


    </head>

    Now here is my query: Can i adapt this method so that it will call the stylsheets from an xml doc.

    The idea being that with each new sheet i create or each sheet i delete I would only have to edit the XML page by adding and deleting links to the new sheets.

    Please consider the fact that I am not a coder. It as a feat just getting this current method to work.

    Any help would be really appreciated and if anyone can do it I'll give you a big shiney credit and link on my site.

    Thanks

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by irishmark
    I have sucessfully implemented a style swither on my site using the one at http://www.dynamicdrive.com/dynamic...eetswitcher.htm

    Now the problem i have with this is that it requires putting the various diffrent alternative style links in the head of every page of my site. So whenever i create a new style sheet I will have to go through every page and add the link to the new css. This also applies if I want to remove a one.
    Use server-side includes.

    Please consider the fact that I am not a coder. It as a feat just getting this current method to work.
    The methods described above aren't difficult to use; usually just a single line.

    Mike

  3. #3
    Join Date
    Oct 2006
    Location
    London
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks Mike,

    I'll give it a go - lol. I'm only grasping concepts here but i am still managing to getstuff working!

  4. #4
    Join Date
    Oct 2006
    Location
    London
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    All Sorted - the php call function works a treat!

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
  •