@blackflow, I'd follow bruno example, you need a template
for each page that requires different template variables. With a smart use of chunks, you can actually have all templates with the same code, the only thing that will change will be the tvs assigned to them.
Here is an example of my templates (all with same code):
[[$head]]
<body>
<!-- [Container] -->
<div id="container">
[[$header]]
<!-- [Content] -->
<div id="content">
<!-- [Text] -->
<div id="text">
[[$content-template-[ [*template] ]]]
</div>
<!-- [/End Text] -->
[[$sidebar]]
</div>
<!-- [/End Content] -->
</div>
<!-- [/End Container] -->
[[$footer]]
</body>
</html>
The "key" here is the code "[[$content-template-[ [*template] ]]]", because with that you can basically use a different chunk for every template, but the code for each template will be the same (there are many other ways of doing this, you just need to find "your way").
If one page has differences which are not related to Tvs, don't make a template, use the
If or the
andif snippet, or
output modifiers. Combine them with
getResourceField if you need to set up global settings for the whole website.
You can also use a snippet like
this that returns the tree depth, which, combined with the if, andif and output modifier, can allow you to use even less templates.
[ed. note: microcipcip last edited this post 14 years, 7 months ago.]