[Seaside] How to add an image to a style? How handle label strings?

Avi Bryant avi.bryant at gmail.com
Sat Feb 19 23:52:00 CET 2005


On Fri, 18 Feb 2005 01:05:35 +0100, Martin J. Laubach <mjl at laubach.at> wrote:

>    How can I add an URL to a style? In principle, I'd want to do
> something
> like
> 
>    MyComponent>>style
>      ^'body { background-image: url("' , (html imageWithForm: someImage)
> , '") }'
> 
>    but of course I can't do that since I don't have a renderer
> in #style. I can think of several ways to kludge around that, but
> I reckon there's a clean solution for that?

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.  That way you could refer to images through a
relative URL in the stylesheet but that could resolve to something
completely external to your application.  Then serve your images
through apache or whatever (or through comanche or swazoo if you want
to keep it all in-image).


>    And what is the collected wisdom of handling labels? I think I'd
> like to have most label strings outside the image (or at least
> collected in some place) -- I'm not sure I want anyone touching
> the image for trivialities like different wording. I'm really
> uneasy telling someone "Yeah, sure you can have it read 'Abort'
> instead of 'Cancel', just go to WALoginDialog's #renderContentOn:
> and change it there. Oh, and it's also in FooDialog and in
> BarDialog and again in BarfComponent. Surely, there must be
> something better than that?

Again, there surely *should* be, but nobody has implemented it yet. 
The dream I have is of explicitly telling the renderer when you're
giving it a label, so that it can
a) do a lookup into some translation dictionary and
b) switch into a mode where it renders them as text inputs instead,
and edits the translation dictionary

Avi


More information about the Seaside mailing list