[Seaside] Paths to pictures in CSS
David Shaffer
cdshaffer at acm.org
Sun Feb 20 14:16:11 CET 2005
mimik at centrum.cz wrote:
>Hi, i am newbie with Seaside. I am trying to display a background image on a web page, which is declared in CSS file like that:
>
> body { background: url('back.png'); }
>
>but I don't know where do I have to put the back.png file, in which directory. I am testing in on my localhost, so the URL path is http://localhost:9090/seaside/test. I think I must tell Seaside that this URL responds to some directory on my disk, some sort of Web root like in Apache, but I can't find it. Can you help me?
>_______________________________________________
>Seaside mailing list
>Seaside at lists.squeakfoundation.org
>http://lists.squeakfoundation.org/listinfo/seaside
>
>
If you started Seaside with "WAKom startOn: 9090" (or whatever port
number you choose) then the Comanche web server isn't serving plain
files. Use this to restart the server so that it will serve files from
a directory called FileRoot in your squeak image directory (you can, of
course, use any path you like):
| ma seaside |
HttpService allInstancesDo: [:each | each stop. each unregister]
seaside := WAKom default.
ma := ModuleAssembly core.
ma serverRoot: (FileDirectory default directoryNamed: 'FileRoot')
fullName.
ma alias: '/seaside' to: [ma addPlug: [:request | seaside process:
request]].
ma documentRoot: (FileDirectory default directoryNamed: 'FileRoot')
fullName.
ma directoryIndex: 'index.html index.htm'.
ma serveFiles.
(HttpService startOn: 9090 named: 'httpd') plug: ma rootModule
Then, place your bank.png in this "FileRoot" directory and change your
CSS to:
body { background: url('/back.png'); }
So that it uses an absolute URL (not relative to seaside).
Hope this helps!
David
More information about the Seaside
mailing list