Now I want a template for my Tour pages, which would go into the content region of the Parent template.you are not talking about the same thing as a "modx template"
I notice the Tags help page does not list a tag for embedding a Template. I’d be pretty shocked if this is not part of ModX! But there must be a workaround (chunks? can a chunk have variables? Or, can i nest a template inside another template?)A MODX template is a html code, normal complete html code for a page with the addition of special tags for inserting the content for different pages - if you "embedded" one inside the other you would end up with multiple html, body and head tags and possibly headers all of which would make the page invalid html. Chunks are the way you include extra html into the template - this is not a workaround, it is the way it works.
(chunks? can a chunk have variables?what do you mean by a variable?
Or, can i nest a template inside another template?)I think this is possible - but the one nested inside should not have doc type, head, body tags - in other words an empty template - in your example though I would be using chunks - empty templates are useful for other things - a resource has a template, and if for example one is going to use it with ajax it does not need to contain all the other stuff
system of templates and subtemplates, that is not how MODx works.And you don’t think that would be 100% consistent with everything else modx does?
I think your understanding of chunks and templates is back-to-front. Rather than having a ’parent template’ with standard doc declarations and head section, etc, you put those in a [[$header]] chunk instead and then ’include’ them in your templates.
My parent template would be a complete page, with all the doc declarations and head section the full page needs, plus a subtemplate tag in the body, similar to a content tag.
To accomplish this, why not just create three templates? One for StandardPage (with it’s own TVs), one for Gallery (with it’s own TVs) and one for Tour... with it’s own TVs. All three could contain completely different markup, snippets and chunks, but would include a standard header and footer by using chunks.
i have a StandardPage template, a Tour sub-template with it’s own TVs, and a Gallery sub-template with it’s own TV’s. Then in the Document editor, the manager picks the StandardPage template and the Tour subtemplate. Then, the Document editor should only display the TVs for the Tour subtemplate.
Sidebar One==[[$sidebar1]]||Sidebar Two==[[$sidebar2]]||Sidebar Three==[[$sidebar3]]
[[$DeclarationsAndHead]] <table> <tr>[[$MyHeader]]</tr> <tr>[[$SubtemplateChunk1]]</tr> <tr>[[$MyFooter]]</tr> </table> </body> </html>
[[$DeclarationsAndHead]] <table> <tr>[[$MyHeader]]</tr> <tr>[[$SubtemplateChunk2]]</tr> <tr>[[$MyFooter]]</tr> </table> </body> </html>
[[$DeclarationsAndHead]] <table> <tr>[[$MyHeader]]</tr> <tr>[[$SubtemplateChunk3]]</tr> <tr>[[$MyFooter]]</tr> </table> </body> </html>
if($id == 1) {
hideField('tvName');
}