Grails Multi-Region Templates
Grails allows you to easily create a view template for all the pages in your application through sitemesh. Making simple HTML tweaks to the default template works if you only have one main content region to your template. Oftentimes though you might want more than this (a content region and a sidebar region for example). Here’s how you can accomplish this.
First modify your main template to look something like this: main.gsp
You’ll notice that in addition to using the pageProperty tag to denote the main content region (page.main-content), I’ve also included the layoutBody tag directly beneath this. This layoutBody tag will make sure that views that are automatically generated by scaffolded controllers will render those pages correctly as well.
Now, for any view where you’d like to use this template your code will look something like this: index.gsp
Pretty slick.