主题 : 分页问题,系统提示报错,菜鸟我不知所措
级别: 童生
UID: 95373
积分:40 加为好友
威望: 0 精华: 0
主题:8 回复:14
注册时间:2016-12-13
在线时长:0
1#   发表于:2016-12-22 13:49:42  IP:202.19.*.*
写了个分页直接加到模板里,是这样的:
[#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}">&lsaquo;</a>[#t/]
[/#if]
[#if p.firstPage]
<a class="btn-prev disabled" href="javascript:void(0);">&lsaquo;</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);">&rsaquo;</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 找不到??
级别: 版主
UID: 70293
积分:78391 加为好友
威望: 1 精华: 0
主题:7 回复:68397
注册时间:2014-12-03
在线时长:0
2#   发表于:2016-12-22 13:51:30  IP:117.129.*.*
抱歉,自己写的模板有问题请自己研究,论坛不提供开发方面的服务
1
级别: 童生
UID: 95373
积分:40 加为好友
威望: 0 精华: 0
主题:8 回复:14
注册时间:2016-12-13
在线时长:0
3#   发表于:2016-12-22 14:03:21  IP:202.19.*.*
回复第2楼

级别: 版主
UID: 70293
积分:78391 加为好友
威望: 1 精华: 0
主题:7 回复:68397
注册时间:2014-12-03
在线时长:0
4#   发表于:2016-12-22 14:04:37  IP:117.129.*.*
1
1 共1页