Hi There
I have a scriptable email template that I am using with sales order transactions.
I have the following freemarker code:
<#--FM:BEGIN--><#if transaction.item?has_content ><#--FM:END--> <#--FM:BEGIN--><#list transaction.item as itemlist ><#--FM:END--> <#--FM:BEGIN--><#if itemlist.quantitybackordered>0><#--FM:END--><br />
<br /><strong>List 1:</strong>
<#--FM:BEGIN-->${itemlist.item} </#if><#--FM:END--> <#--FM:BEGIN--></#list><#--FM:END--><br />
<#--FM:BEGIN--></#if><#--FM:END--><br />
<span style="font-size:11.0pt"><span style="font-family:"Calibri",sans-serif">.<br />
<br /><strong>List 2:</strong>
<#--FM:BEGIN--><#if transaction.item?has_content ><#--FM:END--> <#--FM:BEGIN--><#list transaction.item as itemlist ><#--FM:END--><#--FM:BEGIN--><#if itemlist.custcol_discontinued_item><#--FM:END--><br />
<br />
<#--FM:BEGIN-->${itemlist.item} </#if><#--FM:END--> <#--FM:BEGIN--></#list></#if><#--FM:END--><br />
There are two lists in this email. I want them to appear only if certain criteria is met. In this case, the backordered quantity is not null, then I want it listed at the top. Otherwise if a custom column is checked. I would like this listed at the bottom
List 1:
<#if transaction.item?has_content ><#list transaction.item as itemlist ><#if itemlist.quantitybackordered>0>
${itemlist.item} </#if></#list>
</#if>
List 2
<#if transaction.item?has_content ><#list transaction.item as itemlist ><#if itemlist.custcol_discontinued_item>
${itemlist.item} </#if></#list></#if>
The lists appear only if the conditions are satisfied. However, the issue I Am finding is that I can't make text surrounding the lists conditional too.
How do I make it so the list, as well as the text preceeding and proceeding the list, appears only if the conditions specified for list 1 and list 2 are met?
Thanks