Written by

Lead Technical Analyst at Missouri Health Connection
Question Scott Beeson · 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.

Comments

Dmitry Maslennikov · Jan 14, 2016

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. 

0
Scott Beeson · Jan 14, 2016

Perfect!  Reminds me of Master Pages for older .NET applications.  This is what I suspected but since I didn't know the term "pane" I couldn't search the documentation.  Thank you!

Perhaps the docs I linked can be updated to reference the page on "panes"

0