We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21163
    • 18 Posts
    I am wondering how best to manage CSS code.

    Basically, templates are given the CSS information they need via the classical method of inserting a <link ...> tag in the header. If I get it right, these CSS files are to be stored in a subdirectory below assets.

    If further I am right, it is not clever to put the CSS into the template as a chunk, as that would inflate the page.

    Now, how can I modify the CSS info inside ModX? As far as I can see, it has no file editor with which I could directly access the files, and there is no place to put the CSS into the ModX-ruled database structure.

    At the moment, I would modify the files at home and push them up via ftp, but this is rather clumsy, there has to be something better! wink

    René
      • 3749
      • 24,544 Posts
      Quote from: neo2dot0 at Sep 10, 2007, 06:13 PM


      Now, how can I modify the CSS info inside ModX? As far as I can see, it has no file editor with which I could directly access the files, and there is no place to put the CSS into the ModX-ruled database structure.
      René

      René,

      In the manager, click on Resources, then click on Manage Files.

      In the right-hand pane, navigate to your CSS file and click on the check mark. It may look like nothing has happened, but if you scroll down, you’ll see an editable version of the file.

      Bob

        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
        • 20289
        • 958 Posts
        Quote from: neo2dot0 at Sep 10, 2007, 06:13 PM

        Now, how can I modify the CSS info inside ModX? As far as I can see, it has no file editor with which I could directly access the files, and there is no place to put the CSS into the ModX-ruled database structure.

        As you would know CSS stands for Cascading Style Sheets, it has nothing to do with MODx exept for style purpose of the templates used inside MODx and ofcourse MODx follows http rules! therefor it has no magic for placing the external files like css or images inside the database!, but it is offering some feature like FileManager to browse/edit/delete/move the files that you have placed them in subdirectories of MODx smiley
          [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
          [td][Wiki] [Persian support forum]
          [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
          [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          It is also possible to use a document as a css file.
          http://wiki.modxcms.com/index.php/Dynamic_CSS_with_TVs
            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
            • 21163
            • 18 Posts
            Thank you!

            Both the hint about the check mark in the file manager (I didn’t know just what the check mark would do, so I unconsciously ignored it. What I did try was the magnifier icon --- this, of course, didn’t let me edit the file.) and the link to the indeed very helpful and well-written Howto are very helpful!

            The method of having the CSS files as documents in the tree is what I had been imagining, and it was there, of course. Now, with the supplementary info about how to really do it at my hands, I think I’ll stick to that method.

            Or to the other. Don’t know yet, but it is really great that both possibilities exist!

            René
              • 3749
              • 24,544 Posts
              Quote from: sottwell at Sep 10, 2007, 10:33 PM

              It is also possible to use a document as a css file.
              http://wiki.modxcms.com/index.php/Dynamic_CSS_with_TVs

              Great tip Susan. That might be useful even for people who don’t want to customize their CSS usage. I wonder if it makes sense to create another Wiki entry with an edited version of that tip that just tells how to use MODx documents as CSS files.

              People who edit their CSS files often might prefer to have them in the document tree rather than navigate to them with the file manager. Some of them might not find that entry or might confused by which parts of it do what they want.

              Bob
                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