[Seaside] Re: CSS question

Lukas Renggli renggli at gmail.com
Mon Jan 9 11:42:35 CET 2006

> >> I don't have a good understanding of how CSS is applied.  I see in
> >> the source view of the page several references to CSS files, but I
> >> do not understand what generates those entities.  Would someone
> >> explain?
> >
> > Right now they are just on http://www.lukas-renggli.ch/sw2/
> > style.css, as referenced from PRPierFrame>>style. You might want to
> > copy those files to one of your servers, and change that URL. I
> > know this solutions is bad, but right now there is no easy way to
> > include the pictures referenced from the CSS otherwise. I am
> > definitely investigating a better solution.
> Check out #resourceUrl: and the #resourceBaseUrl configuration
> parameter.  I'm not sure I totally understand the issue but they
> might help.

I guess this doesn't help, but I might misunderstand the concept ...

What I want to do is to reference images (gif, jpeg) from my CSS
style-sheets that are stored within the source of a subclass of
WAStyleLibrary, so that everything is served trough Seaside.

> > Avi, what do you think about slightly changing the way those
> > libraries are working? My idea would be to map the selected
> > libraries of an application to URLs like http://localhost:8080/
> > seaside/application/_lc=class&_ls=selector so that those files can
> > be directly referenced from within each other and would be also
> > cached across sessions.
> They are already cached across sessions.  The idea behind the current
> approach is that their URL changes IFF the content changes, so that
> they can be cached forever.

Ok, I see, that's clever and my suggestion doesn't change this
particular behaviour ;-)

> > Moreover, i would like to make it possible to return a mime
> > document so that files can be served without the need to tweak
> > something with the web-server. This should be possible in a
> > backward compatible way. What do you think? Should I give a go?
> Isn't this possible already?  What changes are you proposing?

How do I include all the needed files (css and images) within one mcz,
so that people can change to a different subclass of WAStringLibrary
to choose a different look?

Application>>handleRequest: aRequest
	aRequest cookies at: self name ifPresent: [ :value |
		aRequest fields at: self handlerField ifAbsentPut: value ].
	" begin new code "
	aRequest fields at: WAStringLibrary libraryClassField ifPresent: [ :value |
		^ (self libraries
			detect: [ :each | value = each name ]
			ifNone: [ ^ super handleRequest: aRequest ])
				handleRequest: aRequest ].
	" end new code "

	^ super handleRequest: aRequest.

Like this I can put setup my look like:

		^ #( css )

		^ '.foo { image: url(_lc=PRPierStyle&_ls=background); }'

		^ WAResponse mime: 'image/jpeg' document: '....'

This is just an idea, I don't know how to solve this problem otherwise?


Lukas Renggli

More information about the Seaside mailing list