Mailing List webobjects-dev@wocommunity.org Message #531
From: Samuel Pelletier <samuel@samkar.com>
Subject: Re: [WO-DEV] Dynamic URL in CSS
Date: Wed, 8 Oct 2025 08:16:54 -0400
To: WebObjects & WOnder Development <webobjects-dev@wocommunity.org>
Hi Markus,

I have some of these in css files and it works if you use relative urls in your css like this:

background-image: url(../img/rapportOrientation/logo/texte.svg);

The base path is the effective css file path, this exemple is expanded to this when running in Eclipse:


In my project, webserver-resources contains css, fonts, img, js and and scss folders.

 Regards,

Samuel


Le 1 oct. 2025 à 08:53, Markus Ruggiero (rucotec) <markus.ruggiero@rucotec.ch> a écrit :

I have a large customer application that has nicely structured CSS files. Unfortunately in one of them there are some absolute references to WebServerResources

background-image: url(/MyApp/images/logo.png")

This fails when the file is in WebServerResources. Up to now my customer had all resources served statically from Apache. This works in production but is not portable and breaks in Eclipse on my dev machine. 

What would be the best way to convert such CSS URLs? I cannot just put a WOResourceURL in there or some such because the definition is in a separate .css file in WebServerResources, not in a WOComponent.

How to best deal with such things?

Thanks for any tip and help
---markus---




Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster