Hi Again all,
I have a template with a series of template variables within it. These variables are of type ’Image’ to allow users to select an image via the ’Insert’ button. In order to control the image size I am using CSS classes on the image tag. I know there are other methods like phpThumb etc but I could not get this to work and couldn’t get any help with it so I went for plan B.
At least this method allows the user to insert the image (upload if necessary) and browse the images via the resource browser at the same time. Clearly, adding the image via the editor allows them to select sizes and ALT text etc but I have another TV for the ALT text in the manager for this purpose.
The problem is that of course the template has the img tag within it configured like this.
<img class="wide" src="[*Banner_Image*]" alt="[*Banner_Image_Description*]" title="[*Banner_Image_Description*]" />
Now the problem is probably obvious, if the visitor does not enter an image path into the manager TV, the image tag ends up like this.
<img class="wide" src="" alt="" title="" />
This results in the browser showing a placeholder for the image with a ’red cross’ - not great.
Not being a coding guru, I am wondering if there Is a way to get around this situation by for example hiding the img tag if the TV is empty so the browser simply does not display it?
Hope this makes sense - look forward to any replies.
Alan.