Forums / Setup & design / Translation: disable for image, but enable for alt tag
Ulrich L.
Monday 13 November 2006 1:17:42 pm
Hi, I'm looking for an easy(!) way to handle images with alt tags in that way: images should not be translated (only the same image in all site accesses), but alt tags should be enabled to be translated. By default this is always treated together by ezp. I dislike the behaviour that when a translation of an object already exists, uploading an image only affects one language, and in order to provide the same image to all languages you have to upload it repeatedly.
Does anybody have an idea?
Thanks in advance,Ulrich
Tuesday 14 November 2006 12:20:02 pm
Nobody else had this problem before...?
Claudia Kosny
Tuesday 14 November 2006 1:19:25 pm
Hi Ulrich
Lacking a better idea I would set up an addition text line attribute in my objects that hold an image and adapt my templates accordingly. Unfortunately this gets nasty very quickly if you have several pictures in one object...
I think you should post an enhancement request as having translatable alt text is definitely a nice feature.
Claudia
Thursday 16 November 2006 1:50:44 am
Thanks, Claudia.
At the moment I think it would be a good idea to override the respective template (this is templates/content/datatype/view, right?) and to provide a new parameter, e.g. "my_alt_text".
Then the template should be modified in that way that the new parameter is tested for content. In case of any content it would be used, otherwise the default funcionality would act.So I would be able to display anything I want as alt/title tag.
My problem is now, that I have failed so far to create a new custom parameter. Is there any documentation anywhere how to deal with this?
Thursday 16 November 2006 6:04:05 am
Use{attribute_view_gui attribute=$node.object.data_map.<your image attribute> my_alt_text=$node.object.data_map.foo.content}
Then you have the content of the attribute foo (which should be a textline) in the variable $my_alt_text within the template for viewing an image, which is (as you said) usually \templates\content\datatype\view\ezimage.tpl.
Thursday 16 November 2006 11:59:40 am
It turned out I only had problems with the old flow control syntax of the ezimage template. Evereything's fine now, implementation of the custom parameter was easy indeed! It's very convenient now to deal with alt/title tag. Thanks again for your help.