主頁(yè) > 網(wǎng)站建設(shè) > 建站知識(shí) > 織夢(mèng)arclist標(biāo)簽實(shí)現(xiàn)分頁(yè)的方法

織夢(mèng)arclist標(biāo)簽實(shí)現(xiàn)分頁(yè)的方法

POST TIME:2017-11-13 00:43

首先必須在首頁(yè)的</head>前面加上
<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標(biāo)簽中必須含有tagid與pagesize參數(shù)。 第一個(gè)是緩存名,第二個(gè)是單頁(yè)條數(shù);例如:
{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標(biāo)簽,且必須聲明緩存參數(shù)tagid且緩存參數(shù)與arclist中tagid保持一致。例如:
{dede:arcpagelist tagid='index'/}
現(xiàn)在貼上一個(gè)完整代碼供大家測(cè)試參考:
<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'/}



收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266