Make 4 new docs and assign them to your one template to start with! Then create new templates if you want
really different scripts/layouts/code for some doc.
The way modx works is - all the ways work. You can use a file as template, you can make your own tv to call
inside your template as every doc get called by *content* built-in tv.
On my first modx page I used 5 templates while looking at that page today it needed one.
Some snippets e.g. sitemap snippet can let you exclude all docs assigned to certain templates.
But basically with your own tvs you dont need to make a whole lot of templates.
For instance I have a [*headContent*] in my template so I can load scripts for a doc right away.
Then there is PHx... but thats later!
I generally try to see if I can get by with one template and create special purpose templates only if I really need them. As mrhaw suggested, when I look at older sites of mine, I see that I should have used fewer templates.
The key is to put things in the template only if you want them on *every* page.
Some sites do require multiple templates, but creating a new template for each page is definitely practice you will be sorry about later.
-
☆ A M B ☆
- 2,475 Posts
dev_cw, I totally agree with you. Sorry... my post was confusing (late night), so I guess it sounded like I was proposing something else than what you shared.
As a rule, any html that affects the layout should not live in the content. Anything that affects the HOW of something looks is not content. Content is all about the WHAT. Therefore CSS never qualifies as "content". One example of how to think of this comes with images... some images (e.g. background images, rounded corners) only affect how data is displayed, so they should therefore live in a template away from the content. But if the content is an article about Richard Nixon, and you have a jpg of the former president, that probably qualifies as content, so it should probably live in the content.
I guess the other thing to consider is that if your site needs many different templates it may indicate that your overall design esthetic lacks focus. I find the best sites have one main design focus and that all the content fits within that design.
Its also hard to resist adding every cool MODx snippet, javascript library and high eye-candy app out there. But I really like how flexible MODx is with respect to using different tempaltes. Sometimes its just easier to use a new modified template to get something to work the way you want it to.