Content images as CSS background in Ez publish

/ Published in: eZ Publish
Save to your folder(s)

If you need to display content images as background on a element. You need to set height, width and background for the element

Copy this code and paste it in your HTML
  1. {foreach $images as $image}
  2. <div style="height:{$image.data_map.image.content['original'].height}px;width:{$image.data_map.image.content['original'].width}px;background: url(http://{ezini( 'section', 'SiteURL', 'site.ini' )}{$image.data_map.image.content['original'].url|ezroot(no)}) no-repeat;">{$|wash}</div>
  3. {/foreach}

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.