Image captions

Image captions

Tuesday 08 May 2007 5:54:14 am - 2 replies

Author Message

Betsy Gamrat

Tuesday 08 May 2007 7:20:38 pm

Bill,

You should be able to edit the datatype override for the images (content/datatype/view/ezimage.tpl) and add the caption underneath, with something similar to:

{$node.data_map.image.content.caption}

Good luck.

Bill Rust

Wednesday 09 May 2007 7:40:16 am

Many thanks for your help Betsy. I had a go at what you suggested but, perhaps being a bit of a eZ newbie, I think I'm missing something.

A little more information, I created a XML text field in the administrator side and called it caption. Now when I create articles there is a field for the caption. In the ezimage.tpl, underneath the below code I tried yours.

  {section show=$href}<a href={$href} {section show=$target}target={$target}{/section}>{/section}<img src={$image.url|ezroot} width="{$image.width}" height="{$image.height}" {section show=$hspace}hspace="{$hspace}"{/section} border="{$border_size}" alt="{$image.text|wash(xhtml)}" title="{$image.text|wash(xhtml)}" />{section show=$href}</a>{/section}

I also tried:

<div class="attribute-caption" style="width: {$object.data_map.image.content[$object_parameters.size].width}px">
        {attribute_view_gui attribute=$object.data_map.caption}
    </div>

as in the embedded images the captions work and this second piece of code is from there. However, it still doesn't work. Any idea of where I'm going wrong?

You must be logged in to post messages in this topic!

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