<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

织梦dede自定义内容分页,datalist运用实例

时间:2020-12-15

在/plus文件夹中新建一个ceshi.php文件。。
<?php
 require(dirname(__FILE__)."/../include/common.inc.php");
 require_once(DEDEINC.'/datalistcp.class.php');
 //读取留言列表
 $dl = new DataListCP();
 $dl->pageSize = 10;              //设定每页显示记录数(默认25条)
 //$dl->SetParameter(typeid,$typeid);    //设定get字符串的变量  $typeid就是传递值
 //这两句的顺序不能更换
 if(empty($s_tmplets)) {
     $s_tmplets = '/plus/ceshilist.htm';
     $tplfile = DEDETEMPLATE.$s_tmplets;
     $dl->SetTemplate($tplfile);      //载入模板
     $sql = "SELECT * FROM `archives`"; //自定义 传递值加载条件内where typeid=".$typeid
     $dl->SetSource($sql);            //设定查询SQL
     $dl->Display();                  //显示
     $dl->Close();
     }
?>

新建模板  /templets/plus/ceshilist.htm
在对应的模板中写入
{dede:datalist}
<li><a target="_blank" title="{dede:field.fulltitle/}"  >{dede:field.title/}</a></li>
{/dede:datalist}
<ul  >
{dede:pagelist listsize='2' listitem='info index pre pageno next end option'/}
</ul  >

这样就能调用一个表单,并且有分页的数据了
测试访问:自己的网址/plus/ceshi.php
0
首页
案例
关于
联系