写了个分页直接加到模板里,是这样的:
[#if p.totalPage gt 1]
<div class="page-box" id="J_pages">
[#if !p.firstPage]
<a class="btn-prev" href="${hrefFormer}[#if p.prePage gt 1]_${p.prePage}[/#if]${hrefLatter}">‹</a>[#t/]
[/#if]
[#if p.firstPage]
<a class="btn-prev disabled" href="javascript:void(0);">‹</a>[#t/]
[/#if]
[#list 1..p.totalPage as i]
<a [#if p.pageNo == i] class="active" href="javascript:void(0);">[#else] href="${hrefFormer}[#if i gt 1]_${i}[/#if]${hrefLatter}">[/#if]]${i}</a>[#t/]
[/#list]
[#if !p.lastPage]
<a class="btn-next" href="${hrefFormer+'_'+p.nextPage+hrefLatter}">&rsaquo</a>[#lt/]
[/#if]
[#if p.lastPage]
<a class="btn-next disabled" href="javascript:void(0);">›</a>[#lt/]
[/#if]
</div>
[/#if]
在我生成栏目页面的时候,弹窗提示模板报错:
The following has evaluated to null or missing: ==> p [in template "ifab/default/style_page/channel.html" at line 1, column 6] 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 (print stack trace for 1 more): ==> #if p.totalPage gt 1 [in template "ifab/default/style_page/channel.html" at line 1, column 1]
提示好像说什么 p 找不到?? |
|