首页 > CMS建站 > 织梦DEDE > 正文

在dede会员中心调用当前模板head.htm和footer.htm

2020-07-02 22:19:34
字体:
来源:转载
供稿:网友
这篇文章主要为大家详细介绍了在dede会员中心调用当前模板head.htm和footer.htm,具有一定的参考价值,感兴趣的小伙伴们可以参考一下,有需要的朋友可以收藏方便以后借鉴。

       前面有提到,在织梦DEDEcms的/member和/plus文件夹下,有许多模板需要调用当前模板的头部和尾部,但是笔者发现,同时使用同一个变量<?php pasterTempletDiy("head.htm"); ?>会出现问题,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会员中心调用当前模板head.htm和footer.htm的全部内容,希望对大家的学习和解决疑问有所帮助,也希望大家多多支持错新网。
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表