User Style Sheets
  • I’m trying to implement user style sheets. There are readers who don’t some parts of like our design, and I would like to offer them a way to change it as they like. Everybody may have an own style sheet, chosen by a cookie.
    I’ve set up a cookie for myself, and created a simple check: if the cookie is set and the file called with is existing, then let’s change to another style sheet. But I can’t find the place to add it to. Tried to add it to several php files in the code, but the final page rendering is still containing the original style.css in the theme directory.
    So well, please, how can I change the sheet? Is there a function call for it, or something?
  • I had a theme switcher on one of my old blogs - it was quite a simple affair with just a few different colour schemes. I listed all the alternate style sheets in my theme's header.tpl.

    The theme-switching script I use was this one. You may get some better help/ideas from the link.

    http://www.dynamicdrive.com/dynamicindex9/stylesheetswitcher.htm

  • Thank you, Stanley. Meanwhile, I had accepted the suggestion of a reader of ours, who called my attention to embedding PHP into the style sheet. Now it’s only in experimental stage yet, but a few colors can be changed. The settings are stored in a cookie. It doesn’t need Javascript, what makes it simpler, I believe.

In this Discussion