<![CDATA[ Support/Comments for addCssWidget - MODX Community Forums]]> https://forums.modx.com/thread/?thread=38330 <![CDATA[Re: Support/Comments for addCssWidget]]> https://forums.modx.com/thread/38330/support-comments-for-addcsswidget#dis-post-217482

This brings a lot additionnal of flexibility to the table ! Not to mention, efficiency smiley]]>
davidm Nov 07, 2006, 04:24 AM https://forums.modx.com/thread/38330/support-comments-for-addcsswidget#dis-post-217482
<![CDATA[Support/Comments for addCssWidget]]> https://forums.modx.com/thread/38330/support-comments-for-addcsswidget#dis-post-217481 addCssWidget.

Use this forum to post any comments about this addition or any questions you have regarding its use.

Brief Description:
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.

Copy the content of the txt file into a new snippet

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:

&tvname - name of the TV you have just created in step 1.
&csspath - path to your css files, defaults to assets/site/]]>
TobyL Nov 07, 2006, 04:08 AM https://forums.modx.com/thread/38330/support-comments-for-addcsswidget#dis-post-217481