<ul class="submenu">
[#list tag_list as c1]
<li><a href="${c1.url}" target="_self">${c1.name}</a>[#if tag_has_next]|[/#if]</li>
[/#list]
</ul>
报错:FreeMarker template error: The following has evaluated to null or missing: ==> tag_has_next [in template "WEB-INF/t/cms/www/default/include/dyt_navi.html" at line 25, column 83] Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use [#if myOptionalVar??]when-present[#else]when-missing[/#if]. (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault, (myOptionVar.foo)?? The failing instruction (FTL stack trace): ---------- ==> #if tag_has_next [in template "WEB-INF/t/cms/www/default/include/dyt_navi.html" at line 25, column 78]
我想判断如果是最后一个元素 就不添加分隔符“ | ” 如果不是就添加。但是这么写一直报错。这个写法我是查的jeecms网上是这么写的:
[@cms_tag_list count='8']
[#list tag_list as tag]
<a href="${base}/tag/${tag.id}.jspx" target="_blank">${tag.name}</a>
[#if tag_has_next]|[/#if]
[/#list]
[/@cms_tag_list]<div> |
|