运营狗 - 栏目推荐
https://blog.seo135.com/tag/%E6%A0%8F%E7%9B%AE%E6%8E%A8%E8%8D%90/
-
织梦DedeCMS增加栏目推荐功能
https://blog.seo135.com/542.html
2019-06-05T17:31:00+08:00
最终效果后台效果前台效果1、添加字段 (后台-系统-SQL命令行工具-执行)ALTER TABLE `#@__arctype` ADD `ishot` CHAR( 255 ) NOT NULL DEFAULT '';2.修改/dede/templets/catalog_add.htm找到<tr>
<td width="150" class='bline' height="26" style="padding-left:10px;">是否隐藏栏目:</td>
<td class='bline'>
<input type='radio' name='ishidden' value='0' class='np' checked="checked" />
显示
<input type='radio' name='ishidden' value='1' class='np' />
隐藏
</td>
</tr>在下面增加<tr>
<td class="bline" style="padding-left:10px;" width="150" height="26">是否推荐栏目:</td>
<td class="bline">
<input name="ishot" value="1" class="np" type="radio" />
是
<input name="ishot" value="0" class="np" type="radio" checked='1' />
否
</td>
</tr>3.修改/dede/catalog_add.php找到(一共有三处,注意别改少了)ishidden,后面增加ishot,找到'$namerule2','0','0',修改成'$namerule2','0','0','0',4.修改/dede/templets/catalog_edit.htm找到<tr>
<td width="150" class='bline' height="26" style="padding-left:10px;">是否隐藏栏目:</td>
<td class='bline'>
<input type='radio' name='ishidden' value='0' class='np'<?php if($myrow['ishidden']=="0") echo " checked='1' ";?>/>
显示
<input type='radio' name='ishidden' value='1' class='np'<?php if($myrow['ishidden']=="1") echo " checked='1' ";?>/>
隐藏
</td>
</tr>下面增加<tr>
<td class="bline" style="padding-left:10px;" width="150" height="26">是否推荐栏目:</td>
<td class="bline">
<input name="ishot" value="1" class="np" type="radio" <?php if($myrow['ishot']=="1") echo " checked='1' ";?>>
是
<input name="ishot" value="0" class="np" type="radio" <?php if($myrow['ishot']=="0") echo " checked='1' ";?>/>
否
</td>
</tr>5.修改/dede/catalog_edit.php找到如下代码(注意一共有两处)ishidden='$ishidden',下面增加ishot='$ishot',调用方法dede:channel调用{dede:channel row='6' typeid='3' type='son'}
<li [field:ishot runphp="yes"]
if(@me==1) @me="class='hot'";else @me="";
[/field:ishot]>
<a href="[field:typelink/]">[field:typename/]</a>
</li>
{/dede:channel}dede:channelartlist调用<li {dede:field.ishot runphp="yes"}
if(@me==1) @me="class='hot'";else @me="";
{/dede:field.ishot}>
<a href="{dede:field.typeurl/}">{dede:field name='typename'/}</a>
</li>完成。