We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3850
    • 4 Posts
    I’ve been spending a large number of hours over the last week looking at CMS’s and I’ve narrowed it down to two: CMS Made Simple and Modx. Now with CMS Made Simple I have been easily able to modify the sample site - but despite having tried and tried with Modx, I can’t see how to attach a style sheet to a template (which I would then base a document on).

    I have successfully created a style sheet as a document, but as documents are stored in the database, how is it referenced from within the template?

    The biggest stumbling block I am having with Modx is the variable quality of documentation - for example, while the "Designer’s Guide/Template Basics" section explains how to create a template and then goes on to give some style sheet code, it doesn’t explain how to get that, either as a file or document into the system so that the template can use it. I think what would be useful would be a step by step tutorial - taking the standard Modx installation to a customised site.

    For now though, an answer to my CSS question would be great smiley
      • 27376
      • 576 Posts
      If you are talking about creating a style sheet using the MODx document system, you would reference the document by this: [tt][~id~][/tt] Where ’id’ is the id the document you wish to access. When coupled together with the stylesheet link you get this:
      <link rel="stylesheet" type="text/css" href="[~123~]" />

      Just remember to change the ’123’ in my example to the id of your stylesheet.
        • 10298
        • 53 Posts
        First of all there are a lot of documentation
        http://wiki.modxcms.com

        And here you have the correct guide for implementing a css stylesheet as a document
        http://modxcms.com/forums/index.php/topic,5258.0.html

        You can also link to it in your template like this
        <link rel="stylesheet" type="text/css" href="[(base_url)]assets/templates/yourfoldername/yourcssfile.css" />

        Try to look at the default templates how they link to the css file
          • 3850
          • 4 Posts
          Thanks for the help, greatly appreciated.