473,396 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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\bookmark 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
__________________________________
Jul 20 '05 #1
4 1318

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.QuerySting("siteColor")
Case "blue", "red", "green"
theColor = Request.QuerySting("siteColor")
Case Else '// default purple
theColor = "purple"
End Select
%>

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

Brynn
www.coolpier.com

On Sun, 11 Jan 2004 03:51:41 GMT, "George Hester"
<he********@hotmail.com> wrote:
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\bookmark 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
__________________________________


Jul 20 '05 #2
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:40***************@news.comcast.giganews.com.. .

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.QuerySting("siteColor")
Case "blue", "red", "green"
theColor = Request.QuerySting("siteColor")
Case Else '// default purple
theColor = "purple"
End Select
%>

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

Brynn
www.coolpier.com



On Sun, 11 Jan 2004 03:51:41 GMT, "George Hester"
<he********@hotmail.com> wrote:
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\bookmark 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
__________________________________

Jul 20 '05 #3
In article <N4********************@twister.nyroc.rr.com>, "George Hester"
<he********@hotmail.com> writes:
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.


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
Jul 20 '05 #4
Why not:

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

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

George Hester wrote:
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:40***************@news.comcast.giganews.com.. .

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.QuerySting("siteColor")
Case "blue", "red", "green"
theColor = Request.QuerySting("siteColor")
Case Else '// default purple
theColor = "purple"
End Select
%>

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

Brynn
www.coolpier.com

On Sun, 11 Jan 2004 03:51:41 GMT, "George Hester"
<he********@hotmail.com> wrote:
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\bookmark 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


--
| Grant Wagner <gw*****@agricoreunited.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
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: joe | last post by:
Some time ago I set up an ASP application that used a login page which checked a username and password against a database to determine a users authorization to access certain pages on the site....
11
by: Lloyd Sheen | last post by:
Is there any one who has actually done this. I have now scanned more web articles about this with the realization that not one of them (including MSDN docs) outlines how to do this. This is...
1
by: Charles A. Lackman | last post by:
Hello, I have created a User Control within Visual Studio and it contains a button that allows the user to querry a database. I dynamically add additional controls to the page based on the...
4
by: sck10 | last post by:
Hello, I built a web site on our companies intranet. Is there a way to get the user information (user name, machine name etc.) when a person views a web page? -- Thanks in advance, sck10
5
by: footballhead | last post by:
I have a site that has MANY different clothing categories. I have a page set up for displaying the products (productsearch.aspx) when a user clicks one of the category links on the navigation menu....
4
by: luna | last post by:
Where does this function get the name from ? reason i ask is, a user wanted their name changing on the domain, i fixe everything else (email,login etc etc) but this function still displays the old...
2
by: edsuslen | last post by:
I am trying to migrate from asp to asp.net and having problem replacing include with user control. On every page we have include asp that have some common asp code that I need to run before the...
1
by: rudjohn | last post by:
I've been tasked with the not-enviable job of creating an application with multiple, semi-customizable templates. My basic concept, thus far, has been a combination of Master Pages (for layout) and...
18
by: Arthur | last post by:
Hi All, I would like to get the name of the user given their networkID, is this something Active Directory would be useful for?(For intranet users) If so, can you please point me to some sample...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.