We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39501
    • 163 Posts
    When building a small to medium sized website, do you try and build the site out of the smallest number of templates?

    What is your strategy / approach? Also, how many of you use Form Customization rules to make the backend more friendly for clients to manage?
    • Less is more fun, a reasonable number of templates is more practical. I have built quite complex sites using one template a la CSS Zen Garden, the body tag being given a class based on a radio button TV. But when you're spending more time fussing with the CSS than is good for you (or the client) maybe it's a good idea to have two or three templates. It also makes it easier on the client if he doesn't have to remember to choose a style in the TV. So in a sense, you can use templates as a sort of way to categorize resources.

      Instead of having a template for every page that needs specific Javascript libraries or functions, I use snippets to load CSS and Javascript files as needed, using the various $modx->regClient...() API functions.

      I'm still fumbling my way through Form Customization, but once I get it locked into my mind I'll use it a lot. It's especially useful in conjunction with the QuickBar snippet for providing a front-end menu bar for whatever Manager actions your users need to do.

        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
        • 10357
        • 573 Posts
        I aim for less, but if you are creating lots of IF logic, than it time to create more templates .

        I make great use of form customisation, the export xml feature is super handy!
        [ed. note: g5604 last edited this post 11 years, 3 months ago.]
          • 39501
          • 163 Posts
          @ sottwell

          Great to hear your approach. I personally feel less is certainly more.

          And like you say, i've finally started to label my templates by type of layout (grid, text, homepage etc) rather than (portfolio.tpl). Obviously makes them more reusable.

          Feel a little deflated having to turn my 3 templates in to 6 or 7 templates, because thats the only way I can isolate certain TVs on certain pages. Form Customization contraints dont work sad
          http://tracker.modx.com/issues/9012

          Having said that, after reading Bobs Official Guide, I finally plucked up the courage to check them out. Very easy to use once you get your head around them and one of my favourite features in REVO. The ability to customise/rename the backend for clients to understand better makes life (and training time) so much more fun smiley
            • 39501
            • 163 Posts
            Quote from: g5604 at Jan 31, 2013, 11:19 AM
            I am for less, but if you are creating lots of IF logic, than it time to create more templates .

            Trying to get my head round when IF logic should be applied. You think if i'm using IF logic to make the template usable on other resources, I should create new templates? Is this because of processing time?

            LOVE form customization. Do you use contraints at all?
              • 10357
              • 573 Posts
              I sometimes constrain by template, but I have a universal policy that seems to work pretty well for every site. Simple things like changing alias to page address make a big difference to clients.
                • 39501
                • 163 Posts
                @g5604 - Once i'm happy with my overall permissions / form customisation, I will certainly reuse it on other projects.

                I've had no problems renaming elements. Just constraining TVs linked to 1 template on a per page basis. For example: 8 pages share 1 template, but have different TV's displayed on certain pages.