We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21733
    • 1 Posts
    Hiya,

    I thought I had already posted this - but obviously not!!

    I am liking the look of MODx - I haven’t quite finished setting up my first site in it, as I stumbled at the CSS ’block’.

    On the page at: http://www.modxcms.com/template-basics.html (the designers guide), there is mention of templates and CSS, although there is no mention of where to put the static CSS file - whether there is a special directory it needs to be placed in etc. The syntax of this tag
    <link rel="stylesheet" type="text/css" href="style.css" />
    suggests it is in the root of the directory that the template resides in...

    I think it would be useful to give some hints to this on that particular page, as designers will have been used to XHTML docs and css in the root with an images subdir.

    I still haven’t worked this out, but that is because I lost interest after 30 mins of hunting around for the info.

    Keep up the good work,

    Peaces
      • 12637
      • 26 Posts
      HI,
      if you havent still found it...
      CSS should be there in assets>templates>(yourtemplate)>CSS file.
      I too took a long time to figure it out. Onlt after looking at the template code could I figure it out.
      Completely agree with you. Cheers
      icubyx
        • 27708 MODX Staff
        • 2,502 Posts
        There is no right place to put your css files. You can put them in /assets/styles or as I do in /assets/templates/mycustomtemplate/styles or some similar location. Since you are the one placing the CSS link in the head of your HTML template you can make the path be anything under your webroot dir.
          Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
          • 12637
          • 26 Posts
          right. there is no ’right’ place for the css files. I should have said - ’you’ll most likely find them in...’ smiley
            • 7231
            • 4,205 Posts
            There is no right place to put your css files.
            That is the greatest thing here, you can do it how you want it done.
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don&#39;t know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 12637
              • 26 Posts
              Any idea how to get info about CSS placement into the documentation?
              There is no mention of where the CSS files can be placed. I’m sure it will clarify the matter to many more ’seekers’.
                • 27708 MODX Staff
                • 2,502 Posts
                @icubyx

                rthrash (aka Ryan Thrash) and a couple other members of the development team usually update the documentation. It has been somewhat locked for a while and they are not going to be doing much with the docs until after 0.9.7 is released. Certainly an article in the Wiki could be posted to explain all the various possibilities.

                If any of the dev team wants to shed more accurate light on this, please do.

                Jay
                  Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
                  • 7231
                  • 4,205 Posts
                  The approach is that all things CSS and xHTML are up to you. From the docs:
                  Like any HTML code, a MODx template at its most basic is a set of HTML tags to indicate the structure of the page. It begins with the doctype declaration, sets some information in the head, such as where to locate the CSS file for the page, then lays out the structure for the body of the page. This is not intended to be an HTML tutorial;...
                  http://modxcms.com/template-basics.html

                  So what I gather is that you should do as you would in any other html page you put together (understanding HTML is a prerequisite). The only thing to remember really is that the css file needs to be relative to the index.php file, and as always all elements referenced from the css file need to be relative to the css file (not the index.php file). Other than that there are no rules in modx concerning your css files and I would not expect there to ever be (please don’t take away our freedom grin ).
                    [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                    Something is happening here, but you don&#39;t know what it is.
                    Do you, Mr. Jones? - [bob dylan]