Shane, I feel your pain, as i`ve recently gone through this exercise and struggled to find suitable documentation to help, but with the help of these forums, I've got there. Hopefully these steps will explain it a bit and help you through it.
Step 1: create a base extension template [img]https://docs.google.com/open?id=0Bzyh_mW217imXzRYekpnUDRFSm8[/img] Basically, I`m creating my own abstract base stkArticle, where I'm switching off some of the features (table of contents, section header and extras areas). I've also applied my own modelClass which extends STKPageModel<STKPage>. The modelClass holds my data model (which will be populated by some webservice calls via Spring to an existing system we already have). I've also supplied a default templateScript which displays a helpful message of what you should put here. Step 2: extend your base template [img]https://docs.google.com/open?id=0Bzyh_mW217imRldMNWIwdi0wZWc[/img] I`ve now created a specific page template which extends the base. It overrides the templateScript to give it specific html functionality, as well as providing its own title. This freemarker script references the data model from the modelClass using syntax like ${model.parent.state}. This basically calls AllInOneImpl.getState(), which does lazy loading of the state attribute like name, address, etc. Then I reference the specific attributes in html tables/fields like ${model.parent.state.name}. The plan is that my website pages will all use the same data model, but via different scripts. Note that both the base and specific templates are created in my own module, I`ve tried to stay clear of altering the STK configurations directly. Step 3: Expose your new templates [img]https://docs.google.com/open?id=0Bzyh_mW217imQS1uQlZINTdodFk[/img] In order for the templates to appear in the template drop down box for use in assigning to website pages, you need to declare their availability in the site definition. Basically, the foolproof way I`ve found to work is to keep consistant names of the templates, i.e. mssArticle is used as the node name everywhere. Step 4: assign your templates to website pages [img]https://docs.google.com/open?id=0Bzyh_mW217imcE5ZYlRYdzdfak0[/img] So testing this you now get your own flavour of stkArticle with specific html for each page, but it uses all the theme from the demo-project. In my scenario, I'm wanting to inbed a webapp into Magnolia. This could be done through the usual editing each page, but we will have many clients with their own CMS systems and different website design ideas, so I want to deliver my webapp into a consistant deliverable module that each client can choose to install and add in the pages into their website where they like. Shout if the images don`t come out right or something needs explaining. Paul -- Context is everything: http://forum.magnolia-cms.com/forum/thread.html?threadId=f7026260-c2d6-4fbb-8547-c89f8487540a ---------------------------------------------------------------- For list details, see http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
