Images in stylesheet

Author Message

fredrik skau

Friday 01 August 2003 5:44:58 am

Hallo!

Does anyone know if it's possible to display images from a css-file? And in such case, how the syntax is to do so?

Do I have to wrap the image-file in a '|ezimage' like in the templates?
How should the path look?

-Fredrik

Jeroen van Gorkum

Friday 01 August 2003 6:08:14 am

> Does anyone know if it's possible to
> display images from a css-file?

probably not, css files are served directly; they are not parsed by ezp's template engine.

jeroen.

Paul Forsyth

Friday 01 August 2003 7:09:40 am

have a look at your source code for the path of a regular image (displayed from the template) and it should be something like 'design/<design>/images/<image>'.

your css file just needs the full or relative path of the image, which you have just found out.

paul

Bruce Morrison

Friday 01 August 2003 4:45:16 pm

Hi Fredrik

The following works for me.

<style type="text/css">
#primarySection {literal}{{/literal} background: #8CB5C6 url({concat("ctn_2nd_bg_",$primary_section,".gif")|ezimage}) no-repeat top left; {literal}}{/literal}
</style>

All 'static' styles are set in the imported styles sheet then the attributes that change and are set by ez template logic are set below in the head of the document.

Cheers
Bruce
designIT

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.