To bring in CSS/JS/Images from your plugin Use:
<link rel="stylesheet" href="${resource(dir: 'css', file: 'nameof.css', plugin: 'nameofplugin')}" type="text/css">
and see also:
Domanda
I'm trying to modularize my grails app a bit so I'm creating some plugins for some common resources.
If I have layouts, or other views, in my plugin, how would I reference and use them from my main app views? Would I use an attribute in meta to point to the plugin layout? Or the g:applyLayout tag?
ALSO how do I reference CSS, JS and Images which are in my plugin? Using:
<script src="${resource(dir: 'js', file: 'cookie.js')}" type="text/javascript"></script>
my main app does not find them?
Soluzione
To bring in CSS/JS/Images from your plugin Use:
<link rel="stylesheet" href="${resource(dir: 'css', file: 'nameof.css', plugin: 'nameofplugin')}" type="text/css">
and see also: