Topic: Support/Comments for CssSwitcher  (Read 26724 times)

Pages: [1] 2 3 4   Go Down

#1: 23-Mar-2006, 04:19 PM

Moderators

Guillaume
Posts: 711

The future is built today.

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: 26-Jul-2006, 11:10 AM by PaulGregory »
Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !

#2: 23-Mar-2006, 07:50 PM

Coding Team

kylej
Posts: 765

WWW
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

#3: 23-Mar-2006, 07:54 PM

Moderators

Guillaume
Posts: 711

The future is built today.

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.
Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !

#4: 26-Mar-2006, 09:24 AM

Moderators

Guillaume
Posts: 711

The future is built today.

New version is avalaibled : 0.2.0. See my first post.
Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !

#5: 27-Mar-2006, 12:46 PM

StainlessSteelRat
Posts: 30

The love of my life, Leila Autumn

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

#6: 27-Mar-2006, 02:47 PM

Moderators

Guillaume
Posts: 711

The future is built today.

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: 27-Mar-2006, 02:55 PM by Guillaume »
Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !

#7: 28-Mar-2006, 01:40 PM

StainlessSteelRat
Posts: 30

The love of my life, Leila Autumn

That did the trick!  Thanks for the help.

#8: 30-Mar-2006, 03:57 PM

Moderators

Guillaume
Posts: 711

The future is built today.

New version is avalaibled : 0.3.0. See my first post.
Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !

#9: 30-Mar-2006, 08:56 PM

Colin
Posts: 203

I love MODx!

Very handy for accessibility! Smiley

#10: 27-Apr-2006, 01:34 PM

Moderators

Guillaume
Posts: 711

The future is built today.

New released availabled : 0.4.0. See my first post.
Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !

#11: 14-May-2006, 07:19 AM


Rachael
Posts: 28

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_';

#12: 15-May-2006, 06:15 AM

Moderators

Guillaume
Posts: 711

The future is built today.

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
Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !

#13: 20-Jul-2006, 06:09 PM

bugsmi0
Posts: 356

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 ?

#14: 20-Jul-2006, 06:17 PM

Moderators

Guillaume
Posts: 711

The future is built today.

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.
Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !

#15: 20-Jul-2006, 06:25 PM

bugsmi0
Posts: 356

i see and where would we specify the css folder ?

#16: 21-Jul-2006, 02:36 AM

Coding Team

doze
Posts: 4,107

....Boom!

i see and where would we specify the css folder ?

Quote from the start of the snippet: &parsefolder - parse folder to create automatically list of css

bugsmi0, don't you ever read the documentation in the snippets you are using? this is getting pretty fustrating..
New MODx wiki! Please help up with documentation efforts! || Old Wiki

"He can have a lollipop any time he wants to. That's what it means to be a programmer."

#17: 21-Jul-2006, 09:21 AM

Moderators

Guillaume
Posts: 711

The future is built today.

Thanks to you Doze Smiley
Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !

#18: 21-Jul-2006, 10:41 AM

bugsmi0
Posts: 356

after searching a GAzillion pages on the forums and having to read through $ & $ & $ & in a tiny text file line after line, forgive me for it all being blurish and confusing  Wink

perhaps If the snippet didn't have so much stuff cramed into it it would be easier to figure out along with more easy to understand instructions.  I tend to write with the newbie in mind but that's a preference and one should not have to go to programmer school just to understand how a snippet works, write plain english next time IMHO

I rate a snippet how quick and easy it is to understand and setup, if I can't set it up as is in a matter of seconds, its a more complicated snippet, neither good nor bad of course.  As a developer, I would do the same, write it easy 1,2,3

and btw - I tried &parsefolder and that didn't bring up a list,

#19: 22-Jul-2006, 06:13 AM

Moderators

Guillaume
Posts: 711

The future is built today.

and btw - I tried &parsefolder and that didn't bring up a list,
What is the problem ? Could you develop it because I don't know why you can't obtain the good result. What is the snippet call you use ?

You must configure $csspath into the code of the snippet and call the snippet like this :
Code:
[!CssSwitcher? &parsefolder=`1` !]

after searching a GAzillion pages on the forums and having to read through $ & $ & $ & in a tiny text file line after line, forgive me for it all being blurish and confusing  Wink

perhaps If the snippet didn't have so much stuff cramed into it it would be easier to figure out along with more easy to understand instructions.  I tend to write with the newbie in mind but that's a preference and one should not have to go to programmer school just to understand how a snippet works, write plain english next time IMHO

I rate a snippet how quick and easy it is to understand and setup, if I can't set it up as is in a matter of seconds, its a more complicated snippet, neither good nor bad of course.  As a developer, I would do the same, write it easy 1,2,3
Sorry but I don't understand what you want to mean. Could you explain me ?
Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !

#20: 26-Jul-2006, 09:12 AM

Moderators

Guillaume
Posts: 711

The future is built today.

My english is very bad  Embarrassed
Could you explain it please ?
If I understand that you said, I can do the necessary to improve this snippet.
Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
Pages: [1] 2 3 4   Go Up
0 Members and 1 Guest are viewing this topic.