[Seaside] Problem with FileLibrary
Philippe Marschall
philippe.marschall at gmail.com
Mon Feb 12 22:02:23 UTC 2007
2007/2/12, Ron Teitelbaum <Ron at usmedrec.com>:
> The change to WAUrl>>pathString breaks my CSS FileLibrary background.
>
> .tabRounded .navigation-options {
> FONT-SIZE: 93%; BACKGROUND: url(files/USMRSTest2FileLibrary/bg.gif)
> #dae0d2 repeat-x 50% bottom; WIDTH: 100%; LINE-HEIGHT: normal; float: left;
> }
>
> Because it now resolves to: /seaside/phi/files/USMRSTest2FileLibrary/bg.gif
> Instead of: /seaside/files/USMRSTest2FileLibrary/bg.gif
>
> WAUrl>>pathString
> ^ String streamContents: [ :stream |
> stream nextPut: $/.
> path
> do: [ :each | stream nextPutAll: each ]
> separatedBy: [ stream nextPut: $/ ] ]
>
> was changed to:
> WAUrl>>pathString
> ^ String streamContents: [ :stream |
> path do: [ :each |
> stream
> nextPut: $/;
> nextPutAll: each ].
> stream nextPut: $/ ]
>
> The difference appears to be the last $/ which possibly affects the way that
> FileLibrary resolves the path. So is this a bug to Filelibrary or should we
> change the css to include the application path?
I guess your application is at /seaside/phi, right?
files/USMRSTest2FileLibrary/bg.gif
Is a relative URL (like a relative path in Unix) the full depends on
the current "directory" so from /seaside/phi is should really resolve
to /seaside/phi/files/USMRSTest2FileLibrary/bg.gif. So far it looks
for me as everything is doing as it should. Yes file library can't
handle it because it points to /seaside/phi instead of /seaside/files
but that was to be expected.
(I hope this was understandable)
The best thing to do IMHO would be to use absolute urls:
BACKGROUND: url(/seaside/files/USMRSTest2FileLibrary/bg.gif)
If you put your css in the same file library subclass as the
background image you can also use
BACKGROUND: url(bg.gif)
Cheers
Philippe
More information about the Seaside
mailing list