• 全国400电话网上服务平台
    强大号码库资源任选,方便,快捷,快速开通。
    咨询热线:400-1100-266  

    织梦后台新增多个栏目内容及前台调用方法
    POST TIME:2021-05-23 02:36

    相信很多织梦建站的站长都会遇到做一下自定义的功能,比如:织梦栏目管理里面在新增一个栏目内容(如图1所示),这种情况就需要给数据库单独在新增一个字段了。接下来教大家解决方法。

    第一步:给dede_arctype数据库表添加字段, 注:dede_arctype根据自己的数据库前缀自行调整。
            方法一:系统设置-SQL命令行工具      ALTER TABLE `dede_arctype` ADD `content1` TEXT NOT NULL AFTER `content1` ;
            方法二:phpMyAdmin给dede_arctype表新增字段
                    1:dede_arctype表然后选择结构,在底部选择与content之后(不填也行),点击执行。

                       2:新增字段,如图所示填好后,保存就行。

    第二步:打开dede\catalog_edit.php,
         找到:`content`='$content',(大概在54行左右)
         替换成:
           `content`='$content',

           `content1`='$content1',

    第三步:打开dede\templets\catalog_edit.htm,这一步修改很重要。
     1:

    function ShowItem1(){
      ShowObj('head1'); ShowObj('needset');
      HideObj('head2'); HideObj('adset');
      HideObj('head3'); HideObj('ctset');
      HideObj('head4'); HideObj('ctset1');
    }
       
    function ShowItem2(){
      ShowObj('head2'); ShowObj('adset');
      HideObj('head1'); HideObj('needset');
      HideObj('head3'); HideObj('ctset');
      HideObj('head4'); HideObj('ctset1');
    }
      
    function ShowItem3(){
      ShowObj('head3'); ShowObj('ctset');
      HideObj('head1'); HideObj('needset');
      HideObj('head2'); HideObj('adset');
      HideObj('head4'); HideObj('ctset1');
    }
      
    function ShowItem4(){
      ShowObj('head4'); ShowObj('ctset1');
      HideObj('head3'); HideObj('ctset');
      HideObj('head1'); HideObj('needset');
      HideObj('head2'); HideObj('adset');
    }

     2:

     

    <table width="100%" border="0" cellspacing="0" id="head1" cellpadding="0">
              <tr> 
                <td colspan="2" bgcolor="#FFFFFF" align="left">
               <table border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="84" height="24" align="center" background="images/itemnote1.gif">&nbsp;常规选项&nbsp;</td>
                      <td width="84" align="center" background="images/itemnote2.gif"><a href="#" onClick="ShowItem2()"><u>高级选项</u></a>&nbsp;</td>
                      <td width="84" align="center" background="images/itemnote2.gif"><a href="#" onClick="ShowItem3()"><u>单页面内容</u></a>&nbsp;</td>
                      <td width="84" align="center" background="images/itemnote2.gif"><a href="#" onClick="ShowItem4()"><u>底部内容说明</u></a>&nbsp;</td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table> 
             
            <table width="100%" border="0" cellspacing="0" id="head2" cellpadding="0" style="display:none">
              <tr>
                <td colspan="2" bgcolor="#FFFFFF"  style="text-align:left;">
              <table height="24" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td width="84" align="center" background="images/itemnote2.gif" bgcolor="#F2F7DF"><a href="#" onClick="ShowItem1()"><u>常规选项</u></a>&nbsp;</td>
                      <td width="84" align="center" background="images/itemnote1.gif">高级选项&nbsp;</td>
                      <td width="84" align="center" background="images/itemnote2.gif"><a href="#" onClick="ShowItem3()"><u>单页面内容</u></a>&nbsp;</td>
                      <td width="84" align="center" background="images/itemnote2.gif"><a href="#" onClick="ShowItem4()"><u>底部内容说明</u></a>&nbsp;</td>
                    </tr>
                  </table>
                </td>
              </tr>
           </table>
            
           <table width="100%" border="0" cellspacing="0" id="head3" cellpadding="0" style="display:none">
              <tr>
                <td colspan="2" bgcolor="#FFFFFF" style="text-align:left;">
                 <table height="24" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td width="84" align="center" background="images/itemnote2.gif" bgcolor="#F2F7DF"><a href="#" onClick="ShowItem1()"><u>常规选项</u></a>&nbsp;</td>
                      <td width="84" align="center" background="images/itemnote2.gif"><a href="#" onClick="ShowItem2()"><u>高级选项</u>&nbsp;</td>
                      <td width="84" align="center" background="images/itemnote1.gif">单页面内容&nbsp;</td>
                      <td width="84" align="center" background="images/itemnote2.gif"><a href="#" onClick="ShowItem4()"><u>底部内容说明</u></a>&nbsp;</td>
                    </tr>
                  </table>
                </td>
              </tr>
           </table>
            
           <table width="100%" border="0" cellspacing="0" id="head4" cellpadding="0" style="display:none">
              <tr>
                <td colspan="2" bgcolor="#FFFFFF" style="text-align:left;">
                 <table height="24" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td width="84" align="center" background="images/itemnote2.gif" bgcolor="#F2F7DF"><a href="#" onClick="ShowItem1()"><u>常规选项</u></a>&nbsp;</td>
                      <td width="84" align="center" background="images/itemnote2.gif"><a href="#" onClick="ShowItem2()"><u>高级选项</u>&nbsp;</td>
                      <td width="84" align="center" background="images/itemnote2.gif"><a href="#" onClick="ShowItem3()"><u>单页面内容</u></a>&nbsp;</td>
                      <td width="84" align="center" background="images/itemnote2.gif">底部内容说明&nbsp;</td>
                    </tr>
                  </table>
                </td>
              </tr>
           </table>


    3:

     

    <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border:1px solid #cfcfcf;background:#ffffff;display:none;text-align:left;" id="ctset1">
              <tr> 
                <td height="28">&nbsp;说明:产品底部内容说明。</td>
              </tr>
              <tr> 
                <td style="padding:10px;">
                    <?php
                    GetEditor("content1",$myrow['content1'],"450","Default","print","false");
                    ?> 
                </td>
              </tr>
          </table>


    至此就修改好了,接下来就行前台调用了
    调用标签:{dede:field.content1/}


    
    关于我们 | 付款方式 | 建站知识 | 增值服务 | 网站模板
    Copyright © 2003-2016
    时间:9:00-21:00 (节假日不休)
    版权所有:巨人网络(扬州)科技有限公司
    总部地址:江苏省信息产业基地11号楼四层
    《增值电信业务经营许可证》 苏B2-20120278
    X

    截屏,微信识别二维码

    微信号:veteran88

    (点击微信号复制,添加好友)

     打开微信

    微信号已复制,请打开微信添加咨询详情!