国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > 織夢DEDE > 正文

織夢欄目列表頁實現(xiàn)第一頁與其他頁調(diào)用不同模板文件

2024-07-12 09:08:35
字體:
供稿:網(wǎng)友

織夢欄目列表頁實現(xiàn)第一頁與其他頁調(diào)用不同模板文件的修改方法如下:

1、打開 /include/arc.listview.class.php 找到,大概在第330行

$this->ParseDMFields($this->PageNo,1);

在它的上面加入

$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$this->TypeLink->TypeInfos['templist'];$tempfile = str_replace("{tid}", $this->TypeID, $tempfile);$tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile);if ( defined('DEDEMOB') ){	$tempfile =str_replace('.htm','_m.htm',$tempfile);}if(!file_exists($tempfile)){	$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/list_default.htm";	if ( defined('DEDEMOB') )	{		$tempfile =str_replace('.htm','_m.htm',$tempfile);	}}if(!file_exists($tempfile)||!is_file($tempfile)){	echo $this->Fields['typename']." [ID:{$this->TypeID}] ".$GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$this->TypeLink->TypeInfos['templist']."模板文件不存在,無法解析文檔!";	exit();}if( $this->PageNo===1 ){	$tempfile2 =str_replace('.htm','_1.htm',$tempfile);	if(file_exists($tempfile2) && is_file($tempfile2))	{		$this->dtp->LoadTemplate($tempfile2);		$this->ParseTempletsFirst();	}}else{	$this->dtp->LoadTemplate($tempfile);}

2、繼續(xù)找到,大概在第450行的

$this->ParseTempletsFirst();

注意是在第450行左右的這個代碼,因為這個代碼有3處,請認(rèn)準(zhǔn)是在大概第450行上這個

找到后在它的上面加入

$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$this->TypeLink->TypeInfos['templist'];$tempfile = str_replace("{tid}", $this->TypeID, $tempfile);$tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile);if ( defined('DEDEMOB') ){	$tempfile =str_replace('.htm','_m.htm',$tempfile);}if(!file_exists($tempfile)){	$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/list_default.htm";	if ( defined('DEDEMOB') )	{		$tempfile =str_replace('.htm','_m.htm',$tempfile);	}}if(!file_exists($tempfile)||!is_file($tempfile)){	echo $this->Fields['typename']." [ID:{$this->TypeID}] ".$GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$this->TypeLink->TypeInfos['templist']."模板文件不存在,無法解析文檔!";	exit();}if( $this->PageNo===1 ){	$tempfile2 =str_replace('.htm','_1.htm',$tempfile);	if(file_exists($tempfile2) && is_file($tempfile2))	{		$this->dtp->LoadTemplate($tempfile2);	}}else{	$this->dtp->LoadTemplate($tempfile);}

3、第一頁模板,在原欄目列表模板后面加_1

例如,原列表模板是 list_article.htm

如果你想讓第一頁跟list_article.htm不一樣的話,你可以建立一個

list_article_1.htm

系統(tǒng)在動態(tài)或者生成靜態(tài)時,欄目列表第一頁優(yōu)先去找這個 _1 的第一頁模板文件,存在就輸出,不存在就使用默認(rèn)的原列表模板 list_article.htm

最后更新系統(tǒng)緩存,靜態(tài)的生成,動態(tài)的直接查看效果

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 吉林省| 河池市| 化州市| 安丘市| 桐乡市| 滨海县| 潞西市| 黄山市| 盐源县| 隆德县| 鄂托克旗| 安徽省| 宁津县| 道孚县| 合阳县| 宜黄县| 万安县| 平山县| 汪清县| 武定县| 大新县| 绍兴市| 丰城市| 日喀则市| 新昌县| 长海县| 沂南县| 新丰县| 西林县| 香河县| 新营市| 延吉市| 石景山区| 措美县| 大悟县| 墨脱县| 奎屯市| 原平市| 屯昌县| 岳阳县| 杭州市|