织梦学习网,专业提供DEDECMS模板,DEDECMS教程,网页特效素材等建站资源!
当前位置:ca88老虎机 > 织梦教程 > 二次开发 >

织梦cms使用arclist标签实现分页的方法

整理编辑:织梦学习网 更新时间:2016-07-15 阅读:
  首先必须在首页的</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标签中必须含有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><a href="[field:arcurl/]">[field:title/]</a></li>

  <p>[field:info/]...</p>

  {/dede:arclist}

  {dede:arcpagelist tagid='index'/}

ca88老虎机 www.casmzx.com 转载请注明出处:http://www.casmzx.com/dedejiaocheng/eckf/934.html

关键词: 织梦 arclist 分页
ca88老虎机