Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-78181

Freemarker snippet in Template editor don't use list item

    Details

      Description

      If you add a repeatable image in a template, the codeĀ uses the image list instead of cur_images to get the fileEntryId.

      ${images.getAttribute("fileEntryId")} should be ${cur_images.getAttribute("fileEntryId")}
      
      Freemarker Code with bug
      <#if images.getSiblings()?has_content>
        <#list images.getSiblings() as cur_images>
          <#if cur_images.getData()?? && cur_images.getData() != ""> 
            <img data-fileentryid="${images.getAttribute("fileEntryId")}" alt="${cur_images.getAttribute("alt")}" src="${cur_images.getData()}" />
          </#if>
        </#list>
      </#if>
      
      Freemarker Code as it should be
      <#if images.getSiblings()?has_content>
        <#list images.getSiblings() as cur_images>
          <#if cur_images.getData()?? && cur_images.getData() != ""> 
            <img data-fileentryid="${cur_images.getAttribute("fileEntryId")}" alt="${cur_images.getAttribute("alt")}" src="${cur_images.getData()}" />
          </#if>
        </#list>
      </#if>
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 38 weeks, 1 day ago

                Packages

                Version Package
                7.0.0 DXP FP40
                7.0.0 DXP SP7
                7.0.5 CE GA6
                7.0.X
                7.1.0 M2
                Master