我试图使用一个行业列表来确定输出文本。例如,如果行业是分发&批发或eCommerce或制造显示一些文本,否则显示一些其他文本。
下面的代码有一些问题:
<#if (customer.custentity_esc_industry)=["Distribution \a Wholesale","eCommerce","Manufacturing"]>some text<#else>some other text</#if>但是我似乎不能让它正常工作..。有什么想法吗?
发布于 2015-07-10 22:03:39
<#if ["Distribution \a Wholesale", "eCommerce", "Manufacturing"]
?seq_contains(customer.custentity_esc_industry)>
some text
<#else>
some other text
</#if>甚至(?then需要2.3.23):
${["Distribution \a Wholesale", "eCommerce", "Manufacturing"]
?seq_contains(customer.custentity_esc_industry)
?then("some text", "some other text")}发布于 2015-07-10 20:20:48
你可以这样做:
<#assign sequence = ["Distribution \a Wholesale","eCommerce","Manufacturing"] />
<#assign flag = 0 />
<#list sequence as seq>
<#if customer.custentity_esc_industry == seq>
<#assign flag =1>
<#break />
</#if>
</#list>
<#if flag == 1>
//some text
<#else>
//some other text
</#if>https://stackoverflow.com/questions/31349315
复制相似问题