core icon indicating copy to clipboard operation
core copied to clipboard

Container Code not displaying images

Open DeanGonzalez opened this issue 14 years ago • 4 comments

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

DeanGonzalez avatar Mar 30 '12 17:03 DeanGonzalez

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

DeanGonzalez avatar Apr 02 '12 15:04 DeanGonzalez

Fixed on master.

jgambarios avatar May 17 '12 15:05 jgambarios

assigned to Prasad

DeanGonzalez avatar May 24 '12 15:05 DeanGonzalez

passed by Prasad

DeanGonzalez avatar May 29 '12 13:05 DeanGonzalez