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.

eZ debug

Timing: Jan 18 2025 19:06:19
Script start
Timing: Jan 18 2025 19:06:19
Module start 'layout'
Timing: Jan 18 2025 19:06:19
Module start 'content'
Timing: Jan 18 2025 19:06:20
Module end 'content'
Timing: Jan 18 2025 19:06:20
Script end

Main resources:

Total runtime0.7251 sec
Peak memory usage4,096.0000 KB
Database Queries64

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 589.8984152.6250
Module start 'layout' 0.00720.0037 742.523439.4453
Module start 'content' 0.01100.7123 781.9688609.0156
Module end 'content' 0.72330.0017 1,390.984412.1719
Script end 0.7251  1,403.1563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4438160.0002
Check MTime0.00130.1756160.0001
Mysql Total
Database connection0.00150.211110.0015
Mysqli_queries0.665891.8213640.0104
Looping result0.00060.0834620.0000
Template Total0.686194.620.3430
Template load0.00220.303020.0011
Template processing0.683994.315120.3419
Template load and register function0.00020.022210.0002
states
state_id_array0.00090.117510.0009
state_identifier_array0.00180.242220.0009
Override
Cache load0.00180.2481280.0001
Sytem overhead
Fetch class attribute can translate value0.00080.116840.0002
Fetch class attribute name0.00090.122950.0002
XML
Image XML parsing0.00110.158040.0003
class_abstraction
Instantiating content class attribute0.00000.001250.0000
General
dbfile0.00320.4415160.0002
String conversion0.00000.001540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs