[Seaside] How to add an image to a style?

Martin J. Laubach mjl at laubach.at
Sun Feb 20 14:24:23 CET 2005


| >    MyComponent>>style
| >      ^'body { background-image: url("' , (html imageWithForm: someImage)
| 
| Unfortunately, there isn't, really.  What I've been meaning to
| experiment with is providing a preference for a base URL that gets
| used (ie, put in the Content-Location header) when serving
| CSS and javascript.

  Hm, an external resource of course works, but I'm trying to keep
all necessary images in-image to keep the installation hassles down.
Well I could, at application startup, write them out to somewhere
they can be served by apache, but that's a work-around at best.

  Perhaps passing in a (reduced) renderer to #style would be
feasible? I've experimented by calculating the url in #renderContentOn:
and then storing the url in an instance var, then using that in
#style -- that works the second time around.

  So having a renderer in #style wouldn't be all that bad. Of course
you'd only have a very reduced capablity for that renderer (basically
all you can do is #urlForDocument).

  Or alternatively, have a possibility of doing #urlForDocument
without a renderer.

	mjl


More information about the Seaside mailing list