• 织梦文章内容页独立内容页模板


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

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

    ALTER TABLE `#@_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='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'];

    完成

  • 相关阅读:
    HUE配置文件hue.ini 的impala模块详解(图文详解)(分HA集群)
    poj 1815 Friendship (最小割+拆点+枚举)
    Android项目中包名的改动
    Android MediaPlayer Error -1004
    hive原生和复合类型的数据载入和使用
    Linux学习笔记之权限与命令之间的关系(重要)及文件与文件夹知识总结
    kafka集群搭建与apiclient创建
    Android中各种Adapter的使用方法
    【从零学习Python】Ubuntu14.10下Python开发环境配置
    leetcode
  • 原文地址:https://www.cnblogs.com/dedehtml/p/9904693.html
Copyright © 2020-2023  润新知