Plugin with CSS using url()

View: New views
4 Messages — Rating Filter:   Alert me  

Plugin with CSS using url()

by Matthew Taylor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I understand how to use the pluginContextPath.  But what about a plugin CSS file that needs to reference an image within the plugin's /web-app/images directory?  I can't use the pluginContextPath within CSS, of course.

Anyone have a slick way to do this?
|:-:| Matthew Taylor
|:-:| Senior Software Engineer
|:-:| SpringSource (http://www.springsource.com)

Re: Plugin with CSS using url()

by Graeme Rocher-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Get the plugin to generate the CSS file from a controller or GSP?

Cheers

On Mon, Oct 6, 2008 at 2:37 PM, Matthew Taylor <matthew@...> wrote:

>
> I understand how to use the pluginContextPath.  But what about a plugin CSS
> file that needs to reference an image within the plugin's /web-app/images
> directory?  I can't use the pluginContextPath within CSS, of course.
>
> Anyone have a slick way to do this?
>
> -----
> Matthew Taylor
> Software Engineer
> G2One Inc.
> http://www.g2one.com
> --
> View this message in context: http://www.nabble.com/Plugin-with-CSS-using-url%28%29-tp19838103p19838103.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>



--
Graeme Rocher
Grails Project Lead
G2One, Inc. Chief Technology Officer
http://www.g2one.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Plugin with CSS using url()

by Matthew Taylor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I should just be able to use a relative path from the CSS file to get to the image.  Something like '../images/image.png' works.
|:-:| Matthew Taylor
|:-:| Senior Software Engineer
|:-:| SpringSource (http://www.springsource.com)

Re: Plugin with CSS using url()

by Mingfai :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

i'm thinking about 2 approaches:
  1. use a Servlet Filter to transform and cache the css
  2. a CSS controller that map to the /css path, and read, transform and cache the css file
in the css, the url is defined as relative path, and either one of the above will "correct" the path. sounds useful. The resource filter/controller could do other magic like validate, compress the files. i actually did sth similar before to merge js files.

regards,
mingfai

On Mon, Oct 6, 2008 at 9:44 PM, Matthew Taylor <matthew@...> wrote:

I should just be able to use a relative path from the CSS file to get to the
image.  Something like '../images/image.png' works.

-----
Matthew Taylor
Software Engineer
G2One Inc.
http://www.g2one.com
--
View this message in context: http://www.nabble.com/Plugin-with-CSS-using-url%28%29-tp19838103p19838222.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



LightInTheBox - Buy quality products at wholesale price!