The color you choose can not be saved, it always turns back to default color once a link is clicked

Comments

derjochenmeyer’s picture

Category: bug » support
Priority: Critical » Minor
Status: Needs work » Postponed

If you read the theme description you will notice that its not a bug... the color picker is an admin tool to simulate a final color scheme...

at the moment i dont have time to figure out a save easy way to save this information to a session of the database... a session would probably be the way to go since its a user specific setting...

drupalferret’s picture

If I may make a suggestion - I think saving it to a session may not be the best way to deal with this. The session would certainly work but only give a partial solution. The text will change colur, but not images, and block styles.

In my opinion, it would be far better to load a completely new stylesheet for the colour selected then store this into a session to preserve the user specific selection. In this way, the design can change all aspects of the layout and not just the font colour. So the logo, header images, tabs and text as well as block and page backgrounds can ll change at the click of a colour swatch.

No idea how to do this myself but the theory can be seen in practice by looking at the ja_antares template created for Joomla. It uses seperate stylesheets and javascript to achieve the same thing :)

derjochenmeyer’s picture

actually a session would exactly do what you describe ;-) in my opinion...

database is no option because it would not work for unregistered users at all and with a large amount of users it would trash the database pretty fast...

in drupals settings.php you can set the session lifetime... its set to about 30 days by default as far as i know...

i could make a request to $_SESSIONS and look if color settings are saved for the current users session... if color information exists if will write a local stylesheet into the HTML document overriding the style.css settings... its pretty straight forward... but when the session is reset it will reset the useres color settings .. thats the problem... .

Goose4all’s picture

maybe a cookie would be the best choice...

unfortionately i am no webdeveleper.. but maybe this is of some help:

http://home.cogeco.ca/~ve3ll/jstutord.htm

cheers
Andreas

DelSurSEO’s picture

I realize this has been post-poned, but this is my question exactly. Once I decide on the best color theme, I want it to be the only one visible, without giving users the option to change the colors.

Can someone tell me how to achieve this? I am guessing it is a modification to the CSS file, but I am inexperienced enough to not know how to deal with this.

Any help appreciated.

EDIT: I found the other threads relating to this issue. I was able to adjust the CSS, and remove the picker-widget from page.tbl.php
Thanks!