在織夢的會(huì)員模板里,你想要統(tǒng)一跟首頁頭尾對應(yīng),想要引入其他有標(biāo)簽的模板的話 {dede:include filename="head.htm"/} 是不能用的,我們可以寫個(gè)自定義方法來實(shí)現(xiàn)
打開 /include/extend.func.php 在文件的最下面加入一個(gè)方法
/**
 *  引入有標(biāo)簽?zāi)0逭{(diào)用方法
 *
 * @access    public
 * @param     string  $filename 模板或路徑
 * @return    string
 */
if(!function_exists('pasterTempletDiy'))
{
function pasterTempletDiy($filename)
{
global $cfg_df_style;
if($filename=='')
        {
            return '';
        }
        if( file_exists($filename) )
        {
            $tmpfile = $filename;
        }
        else if(file_exists(DEDEROOT.'/templets/'.$cfg_df_style.'/'.$filename) )
        {
            $tmpfile = DEDEROOT.'/templets/'.$cfg_df_style.'/'.$filename;
        }
        else
        {
            echo "無法在這個(gè)位置找到: $filename";
        }
require_once(DEDEINC."/arc.partview.class.php");
$dtp = new PartView();
$dtp->SetTemplet($tmpfile);
$dtp->Display();
}
}
在織夢會(huì)員模板里引入默認(rèn)模板的頭部尾部 標(biāo)簽寫法
<?php
pasterTempletDiy("head.htm");
?>
在織夢會(huì)員模板里引入會(huì)員模板里面帶織夢 標(biāo)簽寫法
例如,我在會(huì)員模板目錄里寫一個(gè) diy.htm 里面寫織夢的標(biāo)簽
在會(huì)員首頁模板里加上調(diào)用代碼
<?php
pasterTempletDiy(DEDEMEMBER."/templets/diy.htm");
?>
  • 效果