星联网络专注帝国CMS二次功能插件开发-精品网站模板站长代码素材

  • 最近更新
  • 模板:33
  • 记录:12641|
  • 插件:52|
  • 工具:4|
  • 代码:8|
  • 评论:0

织梦后台新增多个栏目内容及前台调用方法

前言

本文主要讲解《织梦后台新增多个栏目内容及前台调用方法》的详细内容

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

image.png

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

image.png

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

image.png

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

`content1`='$content1',

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

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:

image.png

<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:image.png

<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/}


本网刊登的文章均仅代表作者个人观点,并不代表本网立场。文中的论述和观点,敬请读者注意判断。

本文地址:http://www.xlkjgs.com/notes/web/10407.html

以上内容由本站整理呈现,请务必在转载分享时注明本文地址!如对内容有疑问,请联系我们,谢谢!

星联网络

星联网络是中国最具实战的互联网创业者的知识服务商,这里有互联网行业动态,网络推广,SEO优化,SEM优化,ESC配置,行业经验分型,互联网项目,微信营销、淘宝客赚钱、新媒体营销、京东运营、跨境电商等众多互联网营销知识分享

站长运营站长必备网站运营之道才能长久发展