<#list list1 as list>
<#if (list.title?length>15)>
${list.title[0..15]?default("")}
<#else>
${list.title?default("")}
</#if>
</#list>
如果实际长度没有13那么长的话加多个if
Template Author's Guide/Expressions.
You can nest if directives (of course):
| |||
Note
How to test if x is greater than 1? <#if x > 1> will be wrong, as FreeMarker will interpret the first > as the end of the tag. Thus, either write <#if (x > 1)> or <#if x > 1>.