Question
· Jan 13, 2016

How to create content for child pages of a template?

I created a Zen page with a header. All is good. I then created a new Zen page and during the wizard specified that it was a "subclass of a template page". So now I have Class Custom.App.HomePage Extends Custom.App.TemplateMaster. If I visit HomePage.cls I see the header from the template. However, the HomePage class has no XData Contents section so I have no idea how to actually add content. I tried adding the section but once I do then I don't see the template content anymore.

So, how do I put content in a page that extends another page as a template?

The only documentation I found about templates doesn't really help and unfortunately I don't have access to the sample files mentioned.

Discussion (2)0
Log in or sign up to continue

Templates in ZEN, is a quite simple as I think. When you doing template page just add <pane paneName="MainContent"/>. And then in a children, you should add XData with the same name "MainContent", which starting with tag <pane>.

XData MainContent
{
<pane xmlns="http://www.intersystems.com/zen">
</pane>
}
 

You should not rewrite Contects XData in children pages, and such subpanes could in the same class, or in children.