Stefan Kendall
Stefan Kendall

Reputation: 67892

Robust image URL linking from CSS?

Is there a good way to robustly link to an image in CSS in grails? Originally, I had image paths set to /images/blah, which worked great until the application needed to be deployed in a different context.

Is there a better way to link to images than manually specifying the path to the images relative to the css file? This leaves me with crap like ../../../images/blah, which breaks as soon as the CSS file moves unless you move the file within a smart IDE. This is also ugly as hell.

Upvotes: 2

Views: 202

Answers (1)

schmolly159
schmolly159

Reputation: 3881

You can try using Grails tag libraries with the GSParse plugin to have css and js parsed as a gsp file:

http://nerderg.com/GSParse

http://grails.org/plugin/gsp-arse

Upvotes: 1

Related Questions