We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14933
    • 6 Posts
    Hello All,
    I was evaluating many CMS for a major project of mine and reached here. First thing I need to sort out is how to set up a custom template. I want a fast and less confusing way to setup a template and it seems that MODx could be the solution for it. While going through the documentation at http://modxcms.com/template-basics.html I created a new template file, copied the HTML code into the template edit box and saved the document. The css for the template is supposed to be stored to style.css file according to the example. but the document does not tells (or did i miss that part in the document?) where to create the css file. I searched for the template that I saved but couldn’t find any trace of it in any of the folders. So could some one tell me where to create the style.css file and also where the template is saved by default? Thanks for the help smiley
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The template itself is stored in the database. The CSS file can be wherever you want to put it, just link to it in the template’s HTML head as you would a flat HTML file. The MODx standard location for all files specific to a template is in assets/templates/TemplateName/

      Of course, this is MODx, so there are ways to make a document act as your CSS file, and there are ways to use a file for your template instead of having the whole thing in the database.
        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
        • 14933
        • 6 Posts
        Thanks sottwell. I was able to make it work. One more doubt. Is it possible to have the home page one layout and inner page different layout? If yes is there any tutorial or documentation which deal such issues?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Of course. Make two templates. Set your home page to use your home page template. Go to the Configuration and set your default template to be the inner page template. Now, when you create a document, it will automatically use the second template.
            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