我們都知道織夢(mèng)前臺(tái)模板調(diào)用頭部和尾部標(biāo)簽是{dede:include filename="*.htm"/} ,但是用到會(huì)員中心模板就無(wú)效,今天我們介紹一個(gè)方法來(lái)完成會(huì)員模板調(diào)用前臺(tái)模板。
1:打開(kāi) /include/extend.func.php 在文件的最下面加入一個(gè)方法:
/** * 其他頁(yè)面調(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(); } } |
2:在織夢(mèng)會(huì)員模板其他頁(yè)面引入默認(rèn)模板的頭部尾部 的標(biāo)簽寫(xiě)法
<?php pasterTempletDiy("head.htm"); ?> |