织梦会员模板其他页面引入默认模板的头部尾部

在织梦的会员模板里,你想要统一跟首页头尾对应,想要引入默认的头尾模板的话 {dede:include filename="head.htm"/} 是不能用的,我们可以写个自定义方法来实现

打开 /include/extend.func.php 在文件的最下面加入一个方法

/**
 *  其他页面调用模板的头部尾部模板
 *
 * @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();
	}
}

在织梦会员模板其他页面引入默认模板的头部尾部 的标签写法应该是这样了

<?php
pasterTempletDiy("head.htm");
?>
原文地址:https://www.cnblogs.com/dedehtml/p/9913978.html