前面有提到,在織夢DEDEcms的/member和/plus文件夾下,有許多模板需要調(diào)用當前模板的頭部和尾部,但是筆者發(fā)現(xiàn),同時使用同一個變量<?php pasterTempletDiy("head.htm"); ?>會出現(xiàn)問題,plus能正常使用,而會員中心卻打不開,其實解決辦法很簡單,就是單獨寫變量。方法如下
會員部分打開/member/config.php,在最下面添加如下代碼
//引入arc.partview.class.php類處理require_once(DEDEINC."/arc.partview.class.php");function pasterTempletDiy($path){global $cfg_basedir,$cfg_templets_skin;$tmpfile = $cfg_basedir.$cfg_templets_skin."/".$path;//模版文件的路徑$dtp = new PartView();$dtp->SetTemplet($tmpfile);$dtp->Display();}對應模板用
<?php pasterTempletDiy("head.htm"); ?><?php pasterTempletDiy("footer.htm"); ?>/plus文件部分,把變量pasterTempletDiy換成變量pasterTempletDiy2即可,//引入arc.partview.class.php類處理//////////////////////////////////////////////////////require_once(DEDEINC."/arc.partview.class.php");function pasterTempletDiy2($path){global $cfg_basedir,$cfg_templets_skin;$tmpfile = $cfg_basedir.$cfg_templets_skin."/".$path;//模版文件的路徑$dtp = new PartView();$dtp->SetTemplet($tmpfile);$dtp->Display();}對應模板用
<?php pasterTempletDiy2("head.htm"); ?><?php pasterTempletDiy2("footer.htm"); ?>以上就是在dede會員中心調(diào)用當前模板head.htm和footer.htm的全部內(nèi)容,希望對大家的學習和解決疑問有所幫助,也希望大家多多支持武林網(wǎng)。新聞熱點
疑難解答
圖片精選