Downloads » Resources » addCssWidget

addCssWidget

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Votes: 2

addCssWidget 0.5

by TobyL

Works with MODx Version(s): All
Submitted: Nov 7th 2006 | License: LGPL | Downloads: 1534

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.

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/

Instructions

Previous Releases



Extras

No results found.


( back to top )