• Support/Comments for CssSwitcher#

  • Yogui3 Reply #1, 5 years, 10 months ago

    Reply
    Hello !

    Here a small snippet for users to switch between different style sheets, from the frontend.

    Version: 0.4.1
    Last released : 2006-05-15
    First released : 2006-03-24

    Features (new since last released in bold):
      [list]
    • Display a dropdown list with css you want
    • Generate dropwdown list or html list from a folder if you want
    • Sort css file for the list
    • Ignore files from a list
    • Write the link to the stylesheet in the header for "screen"
    • Write the link to the stylesheet in the header for "print"
    • Possibility to specify one sheet for "print" or a group of sheets with a prefix (1)
    • Can use a different directory to store sheets for "print"
    • Style sheets for "print" are automatically ignore to generate the list of css
    • User preference is saved with a cookie
    [/list]

    bug fix
    (1) If a sheet exists with the same name of the sheet selected for the screen, this sheet will used.
    Else, if the sheet defined by &cssprint exists, it will be used.
    Otherwise, the sheet selected for the screen will be used.

    Demonstration for dropdown menu : http://www.buromatique.fr/
    The file of the latest release is snippet.CssSwitcher.0.4.1.txt

    Mod note: Downloads removed 26Jul06, as this is now in the repository. Here are the historical downloads:

    * snippet.CssSwitcher.txt (6.97 KB - downloaded 228 times.)
    * snippet.CssSwitcher.0.3.0.txt (9.97 KB - downloaded 174 times.)
    * snippet.CssSwitcher.0.4.0.txt (13.06 KB - downloaded 111 times.)
    * snippet.CssSwitcher.0.4.1.txt (13.3 KB - downloaded 103 times.)


  • kjaebker Reply #2, 5 years, 10 months ago

    Reply
    Guillaume,
    This looks great! I like how you have the cookie to remember the settings. One modification that might be nice would be to allow the use of style sheets stored as documents. Maybe if you could specify a document folder and it would use the css documents below that. Then you could have dynamic style sheets with the ability for the user to change the look.

    Great work though, I will have to try this out.

    Kyle


  • Yogui3 Reply #3, 5 years, 10 months ago

    Reply
    I have found a bug : it is impossible to use more than 2 style sheet.
    Please download the latest realsed to fix it, from my first post.


  • Yogui3 Reply #4, 5 years, 10 months ago

    Reply
    New version is avalaibled : 0.2.0. See my first post.


  • StainlessSteelRat Reply #5, 5 years, 10 months ago

    Reply
    Sorry if this seems like a dumb question, but where do I call this snippet? Within the HEAD section of my template? In a chunk within the BODY? I've tried it both places and it didn't seem to work for me. Thanks!

    -Robert



  • Yogui3 Reply #6, 5 years, 10 months ago

    Reply
    Hi
    Quote from: StainlessSteelRat at Mar 27, 2006, 12:46 PM
    Sorry if this seems like a dumb question, but where do I call this snippet? Within the HEAD section of my template? In a chunk within the BODY? I've tried it both places and it didn't seem to work for me. Thanks!
    You can call the snippet in the head and in the body.
    In the head, &display must be '0' to create a link to the style sheet :
    <head>....[!CssSwitcher? &display=`0` !]...</head>

    In the body, $display must be '1' to display a dropdown list:
    <body>...[!CssSwitcher? &display=`1` !]...</body>

    If you have another problem, do not hesitate to ask because this snippet is young.


  • StainlessSteelRat Reply #7, 5 years, 10 months ago

    Reply
    That did the trick! Thanks for the help.


  • Yogui3 Reply #8, 5 years, 10 months ago

    Reply
    New version is avalaibled : 0.3.0. See my first post.


  • colinx Reply #9, 5 years, 10 months ago

    Reply
    Very handy for accessibility!


  • Yogui3 Reply #10, 5 years, 9 months ago

    Reply
    New released availabled : 0.4.0. See my first post.