Are there any good tutorials for using sitemesh in a grails application?

the g:pageProperty is a very powerful, but very poorly documented thing. Lets say in my layout I specify where to put some content like this:

<html>
<body>
<g:pageProperty name="page.header" />
</body>

Now in my page I can specify some content:

<content tag="header">
<!-- header -->
</content>

Sitemesh will take the content tag, regardless of actual position in the HTML of the page and place it where it needs to go in the flow of the layout.

Even better, if within my page I render a template that also specifies a content area with a tag of “header”, it will overwrite the first declaration, and it will be the template’s content that will be rendered in the final layout.

Leave a Comment