Grails: The View Layer [GUM]
by Colin on Feb.04, 2010, under Groovy-Grails
This past month, I did a presentation at the Groovy Users of Minnesota which I called Grails: The View Layer. We took our time delving into the Groovy Server Pages, how Grails utilizes Sitemesh and some of the more obscure tags related to Sitemesh. Currently, Grails’ Sitemesh integration is not very well understood by the community at large and I wanted to spend some time on it since Sitemesh is such a powerful part of the Framework.
I was hoping to spend some more time polishing this slide deck, but hopefully this presentation skeleton is helpful to the community as it is. I am hoping to give this talk again at Gr8Conf in the USA this upcoming April and spend some more time creating more concrete and digestible examples.
February 4th, 2010 on 3:11 am
Submit to Jazoon! You’ll have a free place to stay!
February 4th, 2010 on 10:01 am
Thanks, good material. I was unaware of the pageProperty stuff, and I am sure that will come in handy. I am a little confused about the applyLayout slide (23), could you explain that a bit? any chance there was recorded audio to go with this?
February 4th, 2010 on 11:30 am
@aeischeid, We didn’t record the audio, but I’m going to be putting in more content with some better examples so that I can give this talk again. I hope there are some good hints in it until then. It really deserves some good concrete examples.
February 4th, 2010 on 12:56 pm
Great presentation Colin, thanks for posting it.
I also recently found out that there’s an undocumented g:ifPageProperty tag. Very useful for parameters that might not apply. Here’s an example that optionally includes some content in a layout a property is in the thing the template is being applied to:
<g:ifPageProperty name=”meta.heading”>
<h2 class=”heading”><g:pageProperty name=”meta.heading” /></h2>
</g:ifPageProperty>
Only included if something like this is in the page using the layout’s head:
<meta name=”heading” content=”My Fancy Title”/>
This also applies for the<content> tags too.
February 4th, 2010 on 1:40 pm
Thanks Ted! g:ifPageProperty is one of the undocumented tags we talked about at GUM
There are a few more. I’ll try to locate them all when I do this talk again.
February 4th, 2010 on 8:37 pm
Very good presentation last month. For me, it’s been awhile but I’ll have to re-read the GSP/Sitemesh stuff in ‘Grails in Action’; Just to see if there’s any other hints/gotchas that might help beef up the presentation some. Maybe you could talk a little more Grails dynamic tag libraries?
March 5th, 2010 on 7:23 am
Great stuff, Colin! I really look forward to seeing the presentation at GR8 in the US!