The user determines the Site

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • George Hester

    #1

    The user determines the Site

    My site is all one color basically. But I'd like to give the user the ability to make the site a color of their choice. I have it set up so that they can choose the color of the logon page and save that to favorites if they want. This basically uses a Internet Explorer propietary function.

    Anyway after they save the logon page to favorites\bookm ark in the color of their choice, I'd like to make the rest of the site that color. I'm thinking a cookie? Or maybe use JavaScript to write to a cookie and use that to determine the CSS I'll use for the bgcolor attribute of the <BODY>. Any suggestions how to accomplish this? Thanks.

    --
    George Hester
    _______________ _______________ ____
  • Brynn

    #2
    Re: The user determines the Site


    What I did, is created a different CSS file for each color ... and
    then dynamically write the line to link the right CSS file.

    check it out ... www.coolpier.com and www.hotpier.com are the same
    site in the same web directory ... click the little button in the
    upper right hand corner to toggle between them.

    granted, I have some images dynamically written as well, but anyway

    some ASP code you could use would look similar to this ...

    <%
    Select Case Request.QuerySt ing("siteColor" )
    Case "blue", "red", "green"
    theColor = Request.QuerySt ing("siteColor" )
    Case Else '// default purple
    theColor = "purple"
    End Select
    %>

    <link rel="stylesheet " type="text/css" href="/cp/_main/stylesheets/<%
    =theColor %>_yourstyle.cs s">

    Brynn




    On Sun, 11 Jan 2004 03:51:41 GMT, "George Hester"
    <hesterloli@hot mail.com> wrote:
    [color=blue]
    >My site is all one color basically. But I'd like to give the user the =
    >ability to make the site a color of their choice. I have it set up so =
    >that they can choose the color of the logon page and save that to =
    >favorites if they want. This basically uses a Internet Explorer =
    >propietary function.
    >
    >Anyway after they save the logon page to favorites\bookm ark in the color =
    >of their choice, I'd like to make the rest of the site that color. I'm =
    >thinking a cookie? Or maybe use JavaScript to write to a cookie and use =
    >that to determine the CSS I'll use for the bgcolor attribute of the =
    ><BODY>. Any suggestions how to accomplish this? Thanks.
    >
    >--=20
    >George Hester
    >______________ _______________ _____[/color]

    Comment

    • George Hester

      #3
      Re: The user determines the Site

      Well I only want the one line in the CSS:

      body {bgcolor: color;}

      That's a lot of CSS files about 160 in all. There has to be a better way. But I'll look through that. Thx.

      --
      George Hester
      _______________ _______________ ____
      "Brynn" <z@z.com> wrote in message news:4000c976.1 7706550@news.co mcast.giganews. com...[color=blue]
      >
      > What I did, is created a different CSS file for each color ... and
      > then dynamically write the line to link the right CSS file.
      >
      > check it out ... www.coolpier.com and www.hotpier.com are the same
      > site in the same web directory ... click the little button in the
      > upper right hand corner to toggle between them.
      >
      > granted, I have some images dynamically written as well, but anyway
      >
      > some ASP code you could use would look similar to this ...
      >
      > <%
      > Select Case Request.QuerySt ing("siteColor" )
      > Case "blue", "red", "green"
      > theColor = Request.QuerySt ing("siteColor" )
      > Case Else '// default purple
      > theColor = "purple"
      > End Select
      > %>
      >
      > <link rel="stylesheet " type="text/css" href="/cp/_main/stylesheets/<%
      > =theColor %>_yourstyle.cs s">
      >
      > Brynn
      > www.coolpier.com
      >
      >
      >
      > On Sun, 11 Jan 2004 03:51:41 GMT, "George Hester"
      > <hesterloli@hot mail.com> wrote:
      > [color=green]
      > >My site is all one color basically. But I'd like to give the user the =
      > >ability to make the site a color of their choice. I have it set up so =
      > >that they can choose the color of the logon page and save that to =
      > >favorites if they want. This basically uses a Internet Explorer =
      > >propietary function.
      > >
      > >Anyway after they save the logon page to favorites\bookm ark in the color =
      > >of their choice, I'd like to make the rest of the site that color. I'm =
      > >thinking a cookie? Or maybe use JavaScript to write to a cookie and use =
      > >that to determine the CSS I'll use for the bgcolor attribute of the =
      > ><BODY>. Any suggestions how to accomplish this? Thanks.
      > >
      > >--=20
      > >George Hester
      > >______________ _______________ _____[/color]
      >[/color]

      Comment

      • HikksNotAtHome

        #4
        Re: The user determines the Site

        In article <N4dMb.137659$J W3.99684@twiste r.nyroc.rr.com> , "George Hester"
        <hesterloli@hot mail.com> writes:
        [color=blue]
        >Well I only want the one line in the CSS:
        >
        >body {bgcolor: color;}
        >
        >That's a lot of CSS files about 160 in all. There has to be a better =
        >way. But I'll look through that. Thx.[/color]

        Then dynamically insert the color code on the server. Only one .css file.

        Set a cookie.
        When the page loads, read the cookie.
        Set the color.
        --
        Randy

        Comment

        • Grant Wagner

          #5
          Re: The user determines the Site

          Why not:

          <script type="text/javascript">
          function getColorFromCoo kie() {
          return 'blue';
          }
          document.writel n('<style type="text/css">');
          document.writel n('body { background-color: ' + getColorFromCoo kie() + '; }');
          document.writel n('</style>');
          </script>

          Obviously you replace getColorFromCoo kie() with your own code that reads the cookie.

          George Hester wrote:
          [color=blue]
          > Well I only want the one line in the CSS:
          >
          > body {bgcolor: color;}
          >
          > That's a lot of CSS files about 160 in all. There has to be a better way. But I'll look through that. Thx.
          >
          > --
          > George Hester
          > _______________ _______________ ____
          > "Brynn" <z@z.com> wrote in message news:4000c976.1 7706550@news.co mcast.giganews. com...[color=green]
          > >
          > > What I did, is created a different CSS file for each color ... and
          > > then dynamically write the line to link the right CSS file.
          > >
          > > check it out ... www.coolpier.com and www.hotpier.com are the same
          > > site in the same web directory ... click the little button in the
          > > upper right hand corner to toggle between them.
          > >
          > > granted, I have some images dynamically written as well, but anyway
          > >
          > > some ASP code you could use would look similar to this ...
          > >
          > > <%
          > > Select Case Request.QuerySt ing("siteColor" )
          > > Case "blue", "red", "green"
          > > theColor = Request.QuerySt ing("siteColor" )
          > > Case Else '// default purple
          > > theColor = "purple"
          > > End Select
          > > %>
          > >
          > > <link rel="stylesheet " type="text/css" href="/cp/_main/stylesheets/<%
          > > =theColor %>_yourstyle.cs s">
          > >
          > > Brynn
          > > www.coolpier.com
          > >
          > >
          > >
          > > On Sun, 11 Jan 2004 03:51:41 GMT, "George Hester"
          > > <hesterloli@hot mail.com> wrote:
          > >[color=darkred]
          > > >My site is all one color basically. But I'd like to give the user the =
          > > >ability to make the site a color of their choice. I have it set up so =
          > > >that they can choose the color of the logon page and save that to =
          > > >favorites if they want. This basically uses a Internet Explorer =
          > > >propietary function.
          > > >
          > > >Anyway after they save the logon page to favorites\bookm ark in the color =
          > > >of their choice, I'd like to make the rest of the site that color. I'm =
          > > >thinking a cookie? Or maybe use JavaScript to write to a cookie and use =
          > > >that to determine the CSS I'll use for the bgcolor attribute of the =
          > > ><BODY>. Any suggestions how to accomplish this? Thanks.
          > > >
          > > >--=20
          > > >George Hester[/color][/color][/color]

          --
          | Grant Wagner <gwagner@agrico reunited.com>

          * Client-side Javascript and Netscape 4 DOM Reference available at:
          * http://devedge.netscape.com/library/...ce/frames.html
          * Internet Explorer DOM Reference available at:
          * http://msdn.microsoft.com/workshop/a...ence_entry.asp
          * Netscape 6/7 DOM Reference available at:
          * http://www.mozilla.org/docs/dom/domref/
          * Tips for upgrading JavaScript for Netscape 7 / Mozilla
          * http://www.mozilla.org/docs/web-deve...upgrade_2.html


          Comment

          Working...