在publicCMS上如何实现分页
静态化页面分页可以参考
http://www.publiccms.com/demonstrate/index_2.html
<#if page??> <div class="page"> <#if !page.firstPage> <a href="${getPage(url,page.prePage)}">上一页</a> <#else> <span>上一页</span> </#if> <#assign start=1/> <#if (page.pageIndex-5) gt start> <#assign start=page.pageIndex-4/> </#if> <#assign end=page.totalPage/> <#if (page.pageIndex+5) lt end> <#assign end=page.pageIndex+4/> </#if> <#if start gt 1> <a href="${getPage(url,1)}">1</a> ... </#if> <#list start..end as n><a href="${getPage(url,n)}"<#if n=page.pageIndex> class="selected"</#if>>${n}</a></#list> <#if end lt page.totalPage> ... <a href="${getPage(url,page.totalPage)}">${page.totalPage}</a> </#if> <#if !page.lastPage> <a href="${getPage(url,page.nextPage)}">下一页</a> <#else> <span>下一页</span> </#if> </div> </#if>
动态页面分页可以参考 http://search.publiccms.com/?word=%E6%8E%A5%E5%8F%A3
<#if page??> <div class="page"> <#if !page.firstPage> <a href="?word=${(word?url)!}&tagId=${(tagId?url)!}&page=${page.prePage}">上一页</a> <#else> <span>上一页</span> </#if> <#assign start=1/> <#if (page.pageIndex-5) gt start> <#assign start=page.pageIndex-4/> </#if> <#assign end=page.totalPage/> <#if (page.pageIndex+5) lt end> <#assign end=page.pageIndex+4/> </#if> <#if start gt 1> <a href="?word=${(word?url)!}&tagId=${(tagId?url)!}&page=1">1</a> ... </#if> <#list start..end as n><a href="?word=${(word?url)!}&tagId=${(tagId?url)!}&page=${n}"<#if n=page.pageIndex> class="selected"</#if>>${n}</a></#list> <#if end lt page.totalPage> ... <a href="?word=${(word?url)!}&tagId=${(tagId?url)!}&page=${page.totalPage}">${page.totalPage}</a> </#if> <#if !page.lastPage> <a href="?word=${(word?url)!}&tagId=${(tagId?url)!}&page=${page.nextPage}">下一页</a> <#else> <span>下一页</span> </#if> </div> </#if>
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(1)
静态化页面分页可以参考
http://www.publiccms.com/demonstrate/index_2.html
动态页面分页可以参考 http://search.publiccms.com/?word=%E6%8E%A5%E5%8F%A3