We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35176
    • 193 Posts
    actually, i’m a little confused because there’s a css file type in the resource editor. How do you get a css resource into the file system?

    or don’t you?

    if a resource css is stored in the database, how do you reference it in the html page?
      jealousy<>love
      • 3749
      • 24,544 Posts
      CSS is not normally stored in the DB.

      You can create a CSS file locally, then right-click on the directory (on the Files tab) and select "upload file".
        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
      • While it is usual to use an external file for your css, as in style.css, you can also use a MODx resource as the css file. Your browser doesn’t know or care if it is accessing a file or a MODx resource, the server just sends what is requested, so you would use a URL for either one.
        <link rel="stylesheet" type="text/css" href="http://domain.com/assets/templates/mytemplate/style.css">
        

        - or -
        <link rel="stylesheet" type="text/css" href="http://domain.com/style.css">
        

        The rel and type attributes tell your browser this is a CSS stylesheet, so whether it’s stored (file) or generated (MODx resource) is irrelevant.
          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
          • 35176
          • 193 Posts
          so the second example is used for a css resource, which is stored in the db?
            jealousy<>love
          • That is correct. Your browser requests a resource via its URL (Universal Resource Locator) which in the case of MODx and other CMS applications can be either generated on demand, or retrieved from the filesystem. It makes no difference at all to the browser.
              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