Monday, March 6, 2017, 4:36:12 PM, Ingo Mahnke wrote:
> Hallo,
> one question.
>
> This works:
> <#list imagesLayout?split(";") as x>
> <table border="0" cellspacing="0" cellpadding="0" style="width:100%">
> <tr>
> <#list x?split("-") as y>
> <#assign s = "image"+y>
> <td class="qvImageGalleryImage"><@img
> width="100%" height="185" style="width:100%;" name="${s}"/></td>
> </#list>
> </tr>
> </table>
> </#list>
>
>
>
> Why this will not work:
> <#list imagesLayout?split(";") as x>
> <table border="0" cellspacing="0" cellpadding="0" style="width:100%">
> <tr>
> <#list x?split("-") as y>
> <td class="qvImageGalleryImage"><@img
> width="100%" height="185" style="width:100%;" name="${"image"+y}"/></td>
> </#list>
> </tr>
> </table>
> </#list>
>
>
> Why I have to use the "assign"?
It should be
name="image"+y
or
name="image${y}"
The problem occurs because the @img tag isn't just static like HTML,
so the parameters to it are FTL expressions. "${"image"+y}" isn't a
valid expression (the quotation marks are messed up). "${'image'+y}"
would be valid, but it's not the shortest way.
> Thank you
> Ingo
--
Thanks,
Daniel Dekany
|