• 網(wǎng)站plus文件夾里建立個(gè) form.php
<?php
require_once(dirname(__FILE__)."/../include/common.inc.php");
require_once(DEDEINC.'/datalistcp.class.php');
$sql = "SELECT * FROM `dede_diyform1`";//【diyform1】是你的自定義表單里的【表名】
$dlist = new DataListCP();
$dlist->SetTemplate(DEDETEMPLATE."/plus/form.htm");//templets/plus/form.htm模板路徑
$dlist->SetSource($sql);
$dlist->display();
?>
對(duì)應(yīng)的在,/templets/plus 目錄下新建個(gè) form.htm
{dede:config.pagesize value='5'/}<!--這里設(shè)置每頁顯示的條數(shù)-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>自定義表單</title>
</head>
<body>
<ul>
{dede:datalist}
<li>{dede:field.name /}-----{dede:field.sex /}<li>
{/dede:datalist}
</ul>
{dede:pagelist listsize=5/}
</body>
</html>
{dede:field.name /}{dede:field.sex /}  根據(jù)你自己的自定義表單字段來填寫
如果要引入你默認(rèn)模板的頭部和尾部或者其他,可以使用個(gè)自定義函數(shù)來解決
打開 /include/extend.func.php 加個(gè)函數(shù)
/**
 *  其他頁面調(diào)用模板的頭部尾部模板
 *
 * @access    public
 * @param     string  $path  模板路徑
 * @return    string
 */
if(!function_exists('pasterTempletDiy'))
{
function pasterTempletDiy($path)
{
require_once(DEDEINC."/arc.partview.class.php");
global $cfg_basedir,$cfg_templets_dir,$cfg_df_style;
$tmpfile = $cfg_basedir.$cfg_templets_dir.'/'.$cfg_df_style.'/'.$path;
$dtp = new PartView();
$dtp->SetTemplet($tmpfile);
$dtp->Display();
}
}
自定義模板中調(diào)用
<?php pasterTempletDiy("head.htm"); ?>