Grails template inheritance <p>I'm trying to mimic template inheritance as found in Django with a Grails app. I want to be able to define a '_header.gsp' which includes all the shared resources across the app:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;${title}&lt;/title&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt; %{--Shared Styles--}% &lt;link rel="stylesheet" href="${resource(dir: 'app/shared/css/bootstrap', file: 'bootstrap.min.css')}" type="text/css"&gt; %{--Shared Libraries--}% &lt;script src="${resource(dir: 'lib/jquery', file: 'jquery.js')}"&gt;&lt;/script&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"&gt;&lt;/script&gt; %{--View-specific styles--}% &lt;g:each var="style" in="${styles}"&gt; &lt;link rel="stylesheet" href="${style}" type="text/css"&gt; &lt;/g:each&gt; %{--View-specific scripts--}% &lt;g:each var="include" in="${includes}"&gt; &lt;script src="${include}" type="text/javascript"&gt;&lt;/script&gt; &lt;/g:each&gt; </code></pre> <p>For each specific view template I will include this _header.gsp with a dictionary to fill in the view-specific requirements:</p> <pre><code>&lt;g:render template="/header" model="[ title:'Alerts', styles:[ '${resource(dir: "app/stuff/css", file: "other.css")}', '${resource(dir: "app/stuff/css", file: "second.css")}' ], includes:[ '${resource(dir: "app/stuff/src/main/js/", file: "app.js")}', '${resource(dir: "app/stuff/src/main/js/", file: "filters.js")}' ] ]" /&gt; </code></pre> <p>This is not working, and I'm sure my syntax is wrong somewhere. Can you define a <code>'$resource(dir)'</code> path inside of a g:each like I have? Perhaps I need to use <code>g:link</code>? Can this be done with Grails?</p>