We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20993
    • 37 Posts
    I am mainly a designer and very new to modx and trying to wrap my head around creating my own template. I desinged my own template and inserted all tag in it for the content and so on. Now what I don’t understand is when you create a new template in the admin where do you link your CSS file to? I pasted in my html and when I view my template, it looks like a site with no CSS. I have the same question for all of the images I used, such as my header background pic, where do I upload these to? Obviously I am very new to this, so can anyone take pitty on me.
      • 25663 MODX Staff
      • 12,272 Posts
      Put it wherever you want in the filesystem and reference it from your site root in the template.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 1261
        • 27 Posts
        Ryan,
        I originally posted this to a new thread, but since you answered the bulk of my question already, I’ll just roll it in here:

        In terms of "best practices," where do you recommend storing template files? /assets/templates/<mytemplate> and then /css, /images, etc directories? If I follow this convention for the sake of clarity and organization, will I step on any toes in terms of whatever automated housekeeping modx likes to perform?
          • 25663 MODX Staff
          • 12,272 Posts
          I tend to do the following:
          [*] Put common headers, footers, etc. into {{chunks}}
          [*] Put images in assets/images/
          [*] Put CSS in assets/site/
          [*] Use [*content*] for the most important bit of content on a page
          [*] Create TVs for sidebars, custom variables, image inputs, etc. With TVs I make heavy use of default values and @INHERIT, particularly for different sections and that way I only have to populate the outermost container document with the value for that section.

          (In reality, I think the assets folder is a bit crowded by default and could use a bit of cleaning out ... but that’ll have to wait until we get a fresh file browser. Then I’d stick the css loose in the assets folder.)
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me