織夢arclist標籤怎麼實現分頁?
織夢arclist標籤實作分頁的方法
#首先必須在首頁的9c3bca370b5104690d9ef395f2c5f8d1前面加上
<script language="javascript" type="text/javascript" src=" {dede:global.cfg_cmsurl/}/include/dedeajax2.js"></script>
第二步:必須引入以下javascript程式碼:
<script> function multi(pagenum,tagid) { var taget_obj = document.getElementById(tagid); var taget_obj_page = document.getElementById("page_"+tagid); myajax = new DedeAjax(taget_obj,false,false,'','',''); myajax.SendGet2("/plus/arcmulti.php?mtype=0&pnum="+pagenum+'&tagid='+tagid); myajax = new DedeAjax(taget_obj_page,false,false,'','',''); myajax.SendGet2("/plus/arcmulti.php?mtype=1&pnum="+pagenum+'&tagid='+tagid); DedeXHTTP = null; } </script>
第三步:在arclist標籤中必須含有tagid與pagesize參數。第一個是快取名,第二個是單頁條數;例如:
{dede:arclist tagid='index' pagesize='5'} <li><b><a href="[field:arcurl/]" style="color: #FF6633">[field:title/]</a></b></li> <p class="my_tj_info">[field:info/]...</p> {/dede:arclist}
第四步:必須存在arcpagelist標籤,且必須聲明快取參數tagid且快取參數與arclist中tagid保持一致。例如:
{dede:arcpagelist tagid='index'/}
現在貼上完整程式碼供大家測試參考:
<script language="javascript" type="text/javascript" src=" {dede:global.cfg_cmsurl/}/include/dedeajax2.js"></script> <script> function multi(pagenum,tagid) { var taget_obj = document.getElementById(tagid); var taget_obj_page = document.getElementById("page_"+tagid); myajax = new DedeAjax(taget_obj,false,false,'','',''); myajax.SendGet2("/plus/arcmulti.php?mtype=0&pnum="+pagenum+'&tagid='+tagid); myajax = new DedeAjax(taget_obj_page,false,false,'','',''); myajax.SendGet2("/plus/arcmulti.php?mtype=1&pnum="+pagenum+'&tagid='+tagid); DedeXHTTP = null; } </script> {dede:arclist tagid='index' pagesize='5'} <li><b><a href="[field:arcurl/]" style="color: #FF6633">[field:title/]</a></b></li> <p class="my_tj_info">[field:info/]...</p> {/dede:arclist} {dede:arcpagelist tagid='index'/}
以上是織夢arclist標籤怎麼實現分頁的詳細內容。更多資訊請關注PHP中文網其他相關文章!