addCssWidget
Votes: 30
Tags: Style, snippet, manager, widget
Submitted: Nov 7, 2006
Released: Nov 7, 2006
Downloads: 2107
License: LGPL
addCssWidget 0.5
Works with the following Version(s):
addCssWidget is a snippet that operates as a kind of TV widget. It works together with a Template Variable to easily add extra stylesheets to your documents.
Download
- repo-1156.txt (2107 downloads)
Description
Snippet addCssWidget - add css stylesheets using a TV
Simple 'TV widget' using a snippet
Written by Jelle jager
Version 0.5
Installation:
Copy the content of the txt file into a new snippet
USAGE:
1. Create a TV with a list of css file names (checkbox, dropdown etc)
Do not use an output widget for the TV!
Assign the TV to your template(s)
2. Add snippet call somewhere in your template(s). Position is not
important in this case as the snippet will not output anything itself (output is
generated by $modx->regClientCSS()
Advanced Usage:
You can set the rel, media and title attribute of the <link> tag from the TV as well.
To do this your TV needs to return a comma separeted list of:
css file name,rel,media,title
For example create a TV with input type 'Listbox (multi-select)' and input option values of:
Red==red.css,alternate,screen||Green==green.css,stylesheet,screen||Print==monochrome.css,stylesheet,print
Parameters:
&tvname - name of the TV you have just created in step 1.
&csspath - path to your css files, defaults to assets/site/

Please login to comment.