Using image object for inline background style

Author Message

Martin Sanders

Monday 11 February 2008 10:00:53 am

Hi, How do I go about using an Image attribute within an inline style background-image div?

I've tried using:

<div style="background-image: url({attribute_view_gui image_class=articlethumbnail attribute=$node.data_map.image})">

However this isn't working at it includes the presentation template.

Any help most welcomed.

Felix Laate

Monday 11 February 2008 2:07:48 pm

Hi Martin,

the attribute_view_gui function returns the presentation template of the implicated datatype.

What you need if you whant to refer to an image in CSS is the url of the image. It can be found this way:

{$node.data_map.image.content.IMAGE_VARIATION.full_path}

where IMAGE_VARIATION is "large", "medium", "articlethumbnail" or whatever you would need (assuming that it is defined in image.ini).

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Martin Sanders

Monday 11 February 2008 2:16:14 pm

many thanks :)

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 31 2025 03:41:33
Script start
Timing: Jan 31 2025 03:41:33
Module start 'layout'
Timing: Jan 31 2025 03:41:33
Module start 'content'
Timing: Jan 31 2025 03:41:34
Module end 'content'
Timing: Jan 31 2025 03:41:34
Script end

Main resources:

Total runtime1.1332 sec
Peak memory usage8,192.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0039 588.2656151.2266
Module start 'layout' 0.00390.0030 739.4922220.7344
Module start 'content' 0.00691.1254 960.22664,436.6328
Module end 'content' 1.13230.0008 5,396.85947.8125
Script end 1.1331  5,404.6719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2746160.0002
Check MTime0.00120.1078160.0001
Mysql Total
Database connection0.00050.045310.0005
Mysqli_queries1.054293.0334570.0185
Looping result0.00060.0523550.0000
Template Total1.086195.820.5431
Template load0.00190.166520.0009
Template processing1.084295.679120.5421
Template load and register function0.00140.126510.0014
states
state_id_array0.00230.206810.0023
state_identifier_array0.00120.105620.0006
Override
Cache load0.00140.1250180.0001
Sytem overhead
Fetch class attribute can translate value0.00200.180220.0010
Fetch class attribute name0.00210.187640.0005
XML
Image XML parsing0.00070.061420.0003
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00080.0709160.0001
String conversion0.00000.001940.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.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: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs