On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • This is an auto-generated support/comment thread for 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.

    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/
    • Awesome this will become part of my must-install snippets grin

      This brings a lot additionnal of flexibility to the table ! Not to mention, efficiency smiley
        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l&#39;outil id