Forums / Setup & design / Need automatic ALT-tag to comply with standards..
Valentin Svelland
Tuesday 22 March 2005 3:12:30 am
I'm still running eZp 3.2-6 and need the ALT-tag to always be set to title of associtated article if exists, or else the image name.
Been playing around overriding the templates\image\imageobject.tpl without any luck so far.
Any of u hardcore programmers got a hint here? Tnx.
------------------------ I made eZ run on www.eigersund.kommune.no, bjerkreim.kommune.no, lund.kommune.no and sokndal.kommune.no. Municipalities should use open source!
Bård Farstad
Wednesday 23 March 2005 1:53:21 am
Valentin,
try looking at the template (or your override template) for the image datatype:design/standard/templates/content/datatype/view/ezimage.tpl
--bård
Documentation: http://ez.no/doc
Monday 28 March 2005 2:28:49 pm
Thanks, most helpful. Still I'm having trouble fetching the name of the image to fit into the alt-tag as you can see at the end of the longest line in this code (override/templates/content/datatype/view/ezimage.tpl):
{section show=and(first_set($attribute.content,true()),first_set($attribute.content.contentobject_attribute_id,false()))} {default image_class=original alignment=false() hspace=false() border_size=0} {let image_content=$attribute.content image=$image_content[$image_class]} <img src={$image.full_path|ezroot} width="{$image.width}" height="{$image.height}" {section show=$hspace}hspace="{$hspace}"{/section} {section show=$alignment}align="{$alignment}"{/section} border="{$border_size}" alt="{* I WANT TO PUT IN IMAGE NAME HERE*}" /> {/let} {/default} {/section}