Hi Philipp,

> OK, this is rather a tricky one.
> 
> 1) the CSS resource is loaded from the resources workspace /resources/
> templating-kit/themes/<mytheme>/style.css
> 2) the relative path points obviously to /stk-resources/site/resources/
> templating-kit/themes/<mytheme>/img/layout/navigation.jpg
> 3) this path is translated by a virtual uri mapping (theme-img-to-dms)
> to /dms/templating-kit/themes/<mytheme>/img/layout/navigation.jpg
> 
> But this works only if the pattern matches .*/img/.* which isn't case
> for you: /images/

ah, this explains a lot. That's indeed tricky :-) - thanks for your help.
Renamed the directory inside the DMS, adapted the URI, and, rock'n'roll, it
works!

> Note: in the theme configuration one can also point to a css file
> laying in the normal classpath resources (use then /.resources). In
> this case the relative paths will not underlay any magic. This
> bypasses some of the features of the resource workspace but in many
> cases they are anyway not needed (site awareness, processing, ...).

I rather rewrite the directory then, since I'm not sure if I want to disable
some feature, which I might need again later. Actually, should I need one of
the features of the res workspace later and find it not working, I might end
up confused again :-)

Thanks again for your help
Andreas


> Von: Philipp Bärfuss <[email protected]>
> Antworten an: Magnolia User-List <[email protected]>
> Datum: Tue, 15 Sep 2009 14:55:36 +0200
> An: Magnolia User-List <[email protected]>
> Betreff: Re: [magnolia-user]  URL in CSS in STK?
> 
> 
> OK, this is rather a tricky one.
> 
> 1) the CSS resource is loaded from the resources workspace /resources/
> templating-kit/themes/<mytheme>/style.css
> 2) the relative path points obviously to /stk-resources/site/resources/
> templating-kit/themes/<mytheme>/img/layout/navigation.jpg
> 3) this path is translated by a virtual uri mapping (theme-img-to-dms)
> to /dms/templating-kit/themes/<mytheme>/img/layout/navigation.jpg
> 
> But this works only if the pattern matches .*/img/.* which isn't case
> for you: /images/
> 
> Note: in the theme configuration one can also point to a css file
> laying in the normal classpath resources (use then /.resources). In
> this case the relative paths will not underlay any magic. This
> bypasses some of the features of the resource workspace but in many
> cases they are anyway not needed (site awareness, processing, ...).
> 
> I hope this clarifies it.
> 
> On 14.09.2009, at 14:56, Andreas Weder wrote:
> 
>> 
>> Hi,
>> 
>> how do I properly specify a URL to e.g. a background image in a CSS
>> served
>> by STK?
>> 
>> I currently use something in the line of:
>> 
>>    #nav-global {
>>        background-image:url(../images/layout/navigation.jpg);
>>    }
>> 
>> which also what the default template uses. I configured a new theme
>> along
>> the default "pop" theme. I'm also holding my images in the DMS.
>> 
>> The resulting image URL generated seems to be:
>> 
>> http://localhost:8080/stk-resources/site/resources/templating-kit/themes/
>> <my
>> theme>/images/layout/navigation.jpg
>> 
>> according to Firefox, but no resource is at the URL. A correct URL
>> would
>> have been:
>> 
>> http://localhost:8080/dms/templating-kit/themes/<my
>> theme>/images/layout/navigation.jpg
>> 
>> I'm using Mgnl 4.1 and STK 1.1 on OS X 10.5 using Tomcat 5.5.
>> 
>> Is this maybe a caching problem? Since I'm developing currently I've
>> disabled any subscriber, so no activation takes place, and I guess no
>> caching either.
>> 
>> Thanks
>> Andreas
>> 
>> 
>> ----------------------------------------------------------------
>> For list details see
>> http://www.magnolia-cms.com/home/community/mailing-lists.html
>> To unsubscribe, E-mail to: <[email protected]>
>> ----------------------------------------------------------------
> 
> Best regards,
> 
> Philipp Bärfuss
> Magnolia International Ltd.
> 
> ---------------------------------------
>   Meet us at the Magnolia Conference
>   http://www.magnolia-cms.com/conference
> ---------------------------------------
> 
> Magnolia®  - Simple Open Source Content Management
> 
> 
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
> 


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to