Tuesday 02 December 2008 8:59:13 am
Hi I have a way to add alt and title attributes that seems to work. You will need the str_replace extension function from http://ez.no/developer/contribs/template_plugins/string_replace_operator Once this is active I then altered ezimage.tpl in (my design folder)/templates/content/datatype/view/ezimage.tpl, adding: ... {def $image_name_without_hyphens=ezstr_replace('-',' ',$image.basename)} <img src={$image.url|ezroot} width="{$image.width}" height="{$image.height}" {section show=$hspace}hspace="{$hspace}"{/section} style="border: {$border_size}px;" alt="{$image_name_without_hyphens|wash(xhtml)}" title="{$image_name_without_hyphens|wash(xhtml)}" /> ... This simply uses the name that you give the image when you upload it as the alt and title attributes, having stripped the hyphens that get added to basename out. This also works for embedded images through the OE editor, but use $image_variation.basename instead for those.
|