学习笔记

精准传达 • 价值共享

洞悉互联网前沿资讯,探寻网站营销规律

查看其它板块

织梦文章内容页使用不同的模板_独立内容页模板

作者:狐灵科技 | 2020-02-22 15:50 |点击:

织梦让文章内容页使用不同的模板,不同的模板风格

织梦内容页独立内容模板,可以让文章不同样式展示

织梦文章内容页使用不同的模板_独立内容页模板

1、后台-系统-SQL命令行工具-执行

ALTER TABLE `dede_archives` ADD `tempname` VARCHAR( 40 ) NOT NULL DEFAULT '';

 

2、后台文档发布模板里添加表单

文章模型的是
 

  • 文章模型的是

    • dede/templets/article_add.htm
    • dede/templets/article_edit.htm

    图集模型的是

    • dede/templets/album_add.htm
    • dede/templets/album_edit.htm

    软件模型的是

    • dede/templets/soft_add.htm
    • dede/templets/soft_edit.htm

    商品和自定义模型的是

    • dede/templets/archives_add.htm
    • dede/templets/archives_edit.htm
  • 根据你自己的模型来添加表单,搜索自定义文件名
  • 发布和编辑都是插入如下的代码
    <script type="text/javascript">
    function SelectTemplets(fname)
    {
    	var posLeft = 200;
    	var posTop = 300;
    	window.open("../include/dialog/select_templets.php?f="+fname, "poptempWin", "scrollbars=yes,resizable=yes,statebar=no,width=600,height=400,left="+posLeft+", top="+posTop);
    }
    </script>
    <tr>
    	<td colspan="2">
    		<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:3px;">
    			<tr> 
    				<td width="90" class="bline" height='24'>&nbsp;自定义模板:</td>
    				<td class="bline"><input type='text' name="tempname" id="tempname" style='width:300px' class='text' value="<?php echo $arcRow['tempname']; ?>" /> <input name='diytemp_bt' type='button' class='inputbut' value='浏览...' onClick="SelectTemplets('form1.tempname')" />
    				</td>
    			</tr>
    		</table>
    	</td>
    </tr>

     

    3、后台文档发布和编辑处理php文件修改

    文章模型的是

    • dede/article_add.php
    • dede/article_edit.php

    图集模型的是

    • dede/album_add.php
    • dede/album_edit.php

    软件模型的是

    • dede/soft_add.php
    • dede/soft_edit.php

    商品和自定义模型的是

    • dede/archives_add.php
    • dede/archives_edit.php

    打开对应的文档发布处理,php文件是 xxx_add.php

    找到

    ,weight

    改成

    ,weight,tempname

    继续找到

    ,'$weight'

    改成

    ,'$weight','$tempname'

    文档编辑处理php文件是 xxx_edit.php

    找到

    weight='$weight'

    改成

    weight='$weight',tempname='$tempname'

     

    4、/include/arc.archives.class.php 找到

    $this->Fields['filename'] = empty($this->Fields['filename'])? '' : $this->Fields['filename'];

    在它下面加入

    $this->Fields['tempname'] = empty($this->Fields['tempname'])? '' : $this->Fields['tempname'];

    继续找到

    $cid = $this->ChannelUnit->ChannelInfos['nid'];

    在它下面加入

    $this->Fields['tempname'] = empty($this->Fields['tempname'])? '' : $this->Fields['tempname'];

    继续找到

    $filetag = str_replace('{tid}', $tid,$filetag);

    在它下面加入

    if(!empty($this->Fields['tempname'])) $filetag = $this->Fields['tempname'];

    完成

     


如没特殊注明,文章均为狐灵科技原创,转载请注明  https://www.hulingweb.cn/qxpp/xuexibiji/945.html
多一份免费策划方案,总有益处。

请直接添加技术总监微信联系咨询

网站设计 品牌营销

多一份参考,总有益处

联系狐灵科技,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:023-68168040 / 大客户专线:15523356218