調(diào)用方法如下:
//引入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();}對應(yīng)模板用
<?php pasterTempletDiy("head.htm"); ?><?php pasterTempletDiy("footer.htm"); ?>//引入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();} 對應(yīng)模板用<?php pasterTempletDiy2("head.htm"); ?><?php pasterTempletDiy2("footer.htm"); ?>common.func.php文件里面的變量是全局變量,會和會員中心的沖突,分別設(shè)置不同的變量名即可。
近端時間發(fā)現(xiàn),如果在系統(tǒng)設(shè)置里面勾選“(是/否)支持多站點,開啟此項后附件、欄目連接、arclist內(nèi)容啟用絕對網(wǎng)址”,就會有錯誤提示“找不到對應(yīng)的頭部和尾部”,仔細看路徑上少了“/”,關(guān)閉這項即可。
其實這個功能還是不建議大家打開,后面有很多地方會造成困擾,特別增加了移動端或者二級域名之后。如果增加移動端出現(xiàn)路徑問題比較難解決,可以移步參考《4種方法解dedecms決綁定2級目錄后文章圖片絕對路徑問題》一文,或許對你有不少幫助
新聞熱點
疑難解答
圖片精選