We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4385
    • 372 Posts
    I have all the core CSS for my site in one file and minified. But now I have one page that needs some very specific CSS. Should I just lump it in with all the rest? (It just doesn't feel right) Or add it to the one specific page? I could use a TV to include the path but it lack versatility since it has to be bound to a template. I created a snippet to include the CSS in the head. So I can use a custom CSS on any resource and change the template without worrying about the content.

    [[insertCSS? &customCSS=`my-custom.css`]]


    Any problems with my solution? Is there a better way? Should I even bother and just add it to the rest?
      DropboxUploader -- Upload files to a Dropbox account.
      DIG -- Dynamic Image Generator
      gus -- Google URL Shortener
      makeQR -- Uses google chart api to make QR codes.
      MODxTweeter -- Update your twitter status on publish.
      • 3749
      • 24,544 Posts
      I would probably do what you're doing. If the page is cacheable and the snippet is called cached (no exclamation point), all the CSS should be in the cache (you could look in core/cache/ to make sure).

      You could do some timing checks with your snippet versus putting it in the site CSS, though I'm not sure it's worth the trouble.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting