Jul 05, 2009, 01:40 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Search via SMF or Google: modx forums all of modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
News:Read what MODx Developers say: MODx Dev. Blogs
Pages: [1] 2 3 4   Go Down
  Print  
Author Topic: Support/Comments for CssSwitcher  (Read 19391 times)
0 Members and 2 Guests are viewing this topic.
Guillaume
Moderators
*
Posts: 711


The future is built today.


« on: Mar 23, 2006, 04:19 PM »

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):
  • 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

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.)
« Last Edit: Jul 26, 2006, 11:10 AM by PaulGregory » Logged

Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
kylej
Coding Team
*
Posts: 758



WWW
« Reply #1 on: Mar 23, 2006, 07:50 PM »

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
Logged

Guillaume
Moderators
*
Posts: 711


The future is built today.


« Reply #2 on: Mar 23, 2006, 07:54 PM »

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.
Logged

Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
Guillaume
Moderators
*
Posts: 711


The future is built today.


« Reply #3 on: Mar 26, 2006, 09:24 AM »

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

Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
StainlessSteelRat
Jr. Member
*
Posts: 30


The love of my life, Leila Autumn


« Reply #4 on: 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!

-Robert

Logged
Guillaume
Moderators
*
Posts: 711


The future is built today.


« Reply #5 on: Mar 27, 2006, 02:47 PM »

Hi 
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 :
Code:
<head>....[!CssSwitcher? &display=`0` !]...</head>
In the body, $display must be '1' to display a dropdown list:
Code:
<body>...[!CssSwitcher? &display=`1` !]...</body>
If you have another problem, do not hesitate to ask because this snippet is young.
« Last Edit: Mar 27, 2006, 02:55 PM by Guillaume » Logged

Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
StainlessSteelRat
Jr. Member
*
Posts: 30


The love of my life, Leila Autumn


« Reply #6 on: Mar 28, 2006, 01:40 PM »

That did the trick!  Thanks for the help.
Logged
Guillaume
Moderators
*
Posts: 711


The future is built today.


« Reply #7 on: Mar 30, 2006, 03:57 PM »

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

Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
Colin
Full Member
***
Posts: 188

I love MODx!


« Reply #8 on: Mar 30, 2006, 08:56 PM »

Very handy for accessibility! Smiley
Logged
Guillaume
Moderators
*
Posts: 711


The future is built today.


« Reply #9 on: Apr 27, 2006, 01:34 PM »

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

Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
Rachael
Jr. Member
*
Posts: 28



« Reply #10 on: May 14, 2006, 07:19 AM »

In version 0.4.0 the configuration of $cssprintpre is wrong. This stops parsefolder from working as it filters out all files.

It is
Code:
$cssprintprefixe = 'print_';
but should be
Code:
$cssprintpre = 'print_';
Logged
Guillaume
Moderators
*
Posts: 711


The future is built today.


« Reply #11 on: May 15, 2006, 06:15 AM »

Thanks for your message. In fact there is a bug but not where you indicate it.
This line
Code:
$cssprintpre = isset($cssprintpre) ? $cssprintpre : '';
should be
Code:
$cssprintpre = isset($cssprintpre) ? $cssprintpre : $cssprintprefixe;
This is fix with the version 0.4.1
Logged

Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
bugsmi0
Sr. Member
****
Posts: 356


« Reply #12 on: Jul 20, 2006, 06:09 PM »

where or how to set up the list of different css ?

i have the switch appearing in the page but it only shows default, how to display more ?
Logged

Guillaume
Moderators
*
Posts: 711


The future is built today.


« Reply #13 on: Jul 20, 2006, 06:17 PM »

You must specify the folder wich contains yours css and the list will be generated automatically.
Else, you can specify them manually with a chunk : you add one option on the select box by css.
Logged

Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
bugsmi0
Sr. Member
****
Posts: 356


« Reply #14 on: Jul 20, 2006, 06:25 PM »

i see and where would we specify the css folder ?
Logged

Pages: [1] 2 3 4   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!