In Safari, the ‘alt’ parameter in an ‘img’ link never seems to display the alt text - just shows the ugly box with question mark icon. In IE, the alt value is displayed inside a box and next to a little red icon, while in Firefox the text is shown correctly when an image is missing.
So is there a way of using EE conditionals to display an alternative image, valid for all browsers, when the called one is missing?
In the site which is giving rise to this question, I am calling this image dynamically within the img tag through a custom field which contains a value equivalent to the filename of the underlying image, eg ‘{customfield}.jpg’ resulting in ‘12345.jpg’. The images are not directly linked to the entry fields (just too many of them to implement that), so they sit in a folder on the server, and are referenced by the custom field value which exists already in the database. This setup works fine, but occasionally there is no image to match the custom field value, so the alt value is called and displayed in various unsatisfactory ways, depending on the browser.
I have tried playing around with various conditionals, but can’t seem to find a solution. Using a conditional based on the custom field, such as {if customfield}{/if} does not work because the field value is always there, it’s the underlying image which is missing.
This is probably a newbie-type issue - but any thoughts would be gratefully received. Many thanks.