How to create content for child pages of a template?

25 views Asked by At

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.

1

There are 1 answers

0
risingup On

You can do it using pane's. You can create differents XData with the identifier that you want, and add a pane object using the paneName. This is a simple example:

   Class Custom.App.TemplateMaster
    {
        XData Contents
        {
            <page  xmlns="http://www.intersystems.com/zen" >
                ...
                <pane paneName="HomePageContent" width="100%" />        
                ...
            </page>     
        }
    }




    Class Custom.App.HomePage Extends Custom.App.TemplateMaster
    {
        XData HomePageContent
        {   
            <!-- the specific content of your HomePage ->   
        }
    }