Changing All Our Views at Once

We saw in the previous chapter how Grails uses SiteMesh to provide a consistent look throughout an application. That’s what’s been giving us that cool Grails logo on all of our views. But that’s not quite what our customer wants for TekDays. Let’s see what we can do about that. Open TekDays/grails-app/views/layout/main.gsp, and in the <body> section, modify the first <div>:

things.2/TekDays/grails-app/views/layouts/main.gsp
 
<div​ id=​"logo"​ role=​"banner"​​>​​<a​ href=​"${createLink(uri: '/')}"​​>
 
<img​ src=​"${resource(dir: 'images', file: 'td_logo.png')}"
 
alt=​"TekDays"​​/>​​</a>​​</div>

We renamed the <div>, changed the link to point to the TekDays home page, and replaced the logo. Of course, you ...

Get Grails 2: A Quick-Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.