We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40447
    • 165 Posts
    We all know this post https://forums.modx.com/thread/?thread=19725&page=
    and this css as a document seems to be very popular. As an Evo user I am wondering now, has this become a native feature in Revo ? Maybe also for javascript ? If not maybe something for Modx3 ?

    This question has been answered by sottwell. See the first response.

      • 39501
      • 163 Posts
      wowzers that post was from 6 years ago!

      Yes, this is a native feature in Revo - not sure how long its been there though.

      See attached screen shot.
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        You can also create your own content types in the System -> Content Types menu. Great for using in conjunction with static resources for serving files like .pdf files for download.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 40447
          • 165 Posts
          Thanks for your replies. In Evo you have to do the following to make it work: 1.use the alternate @import rule 2.use the stylesheet's alias 3.Edit your .htaccess to ensure IE compatibility. What I meant with "has this become a native feature in Revo" is, can you do this now in Revo, without the 3 tricks you have to do in Evo ? I'm afraid not is it ?
          Yes that Evo post is more then 6 years old but it holds some very interesting ideas (that's why the post is pinned) for example organizing your css (and js) in chunks on resources. A great way of keeping track of your css/js and find and edit them effortlessly and quickly, even if your website grows bigger. [ed. note: sitecms last edited this post 13 years, 8 months ago.]
          • discuss.answer
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Very simple. Just create your resource and in its Settings tab select the content type. Revo will automatically append the correct filetype (.css) to the alias, and add the correct HTTP headers.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 40447
              • 165 Posts
              Revo will automatically append the correct filetype (.css) to the alias, and add the correct HTTP headers.
              That's interesting, reason enough to install revo and see how it pays off.
                • 3109 ☆ A M B ☆
                • 894 Posts
                Yes and it's an awesome feature may I add, it allows you to use template variables and output modifiers on your css files which can be very helpful.

                You can also create your own content types I wrote a small article about it here

                Try Revo it's a bit to absorb if your coming from Evo but its much more flexible.
                  Benjamin Marte
                  Interactive Media Developer
                  Follow Me on Twitter | Visit my site | Learn MODX
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  An interesting possibility that I have not yet heard of anyone finding a use for is that the requested .css page is a resource like any other resource as far as MODx is concerned, so the SESSION will be available to it just like any other resource requested from the same domain. So snippets could be used to generate custom CSS for individual users, groups of users, or according to any custom values previously set in the SESSION for the user.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 10357
                    • 573 Posts
                    I create my css as resources during development and then switch to minified/gzipped static files when the site goes live. I have not tried using a snippet like minfiyX with css as resources - I wonder if it would work...
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      I'm pretty sure that only works with files. You might be able to use static resources.
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org