Container Code not displaying images
This is also a bug in 1.9.5
To reproduce
1) Create a Structure with and image field 2) Place that structure on a new container and in code field click "add" next to the image variables... should get code like this:
test image
<p>test image</p>
if ($UtilMethods.isSet($imageImageURI))
<img src="$!{myImageImageURI}" alt="$!{myImageImageTitle}" />
end
3) Create a new/copied template and parse the container in the template
4) add a piece of content with image.... code does not work to display the image
http://i1174.photobucket.com/albums/r618/dean_dotcms/StructureWithImage.png
http://i1174.photobucket.com/albums/r618/dean_dotcms/ImageCodeNoWork.png
http://i1174.photobucket.com/albums/r618/dean_dotcms/AddCode.png
The problem here seems to be in this line:
#if ($UtilMethods.isSet($imageImageURI))
the code is always showing $imageImageURI regardless of the velocityname on the image field
In the case above, the code should have been done this way:
<p>test image</p> #if ($UtilMethods.isSet($myImageImageURI)) <img src="$!{myImageImageURI}" alt="$!{myImageImageTitle}" /> #end
... I tested and that works if the first line of the #if statement is fixed
Fixed on master.
assigned to Prasad
passed by Prasad