一、实现效果:我们将导航上面的频道id为2 的图片频道禁止不显示、但不是禁用该频道。我们能通过完整的地址正常访问。
二、实现方法:
1, 修改./templates/default/phpcms/header.html (页头文件)
找到:
<!--频道列表-->
<div id="Whatever" align="center">
<ul class="TabBarLevel1" id="TabPage1">
<li {if $channelid==0}id="Tabi" class="Selected"{/if}><a href="{PHPCMS_PATH}">首页</a></li>
<!--{loop $CHANNEL $channel}-->
<li {if $channelid==$channel['channelid']}id="Tabi" class="Selected"{/if}><a href="{$channel[linkurl]}" class="white">{$channel[channelname]}</a></li>
<!--{/loop}-->
</ul>
</div>
加入下面的语句
{php if($channel['channelid']==2) break;} , 假如频道id为2,则不显示。
可以多加入好几个频道都不显示。如:
{php if($channel['channelid']==2 || $channel['channelid']==7 || $channel['channelid']==52) break;}
2,修改为:
<!--频道列表-->
<div id="Whatever" align="center">
<ul class="TabBarLevel1" id="TabPage1">
<li {if $channelid==0}id="Tabi" class="Selected"{/if}><a href="{PHPCMS_PATH}">首页</a></li>
<!--{loop $CHANNEL $channel}-->
{php if($channel['channelid']==2) break;}
<li {if $channelid==$channel['channelid']}id="Tabi" class="Selected"{/if}><a href="{$channel[linkurl]}" class="white">{$channel[channelname]}</a></li>
<!--{/loop}-->
</ul>
</div>
新闻热点
疑难解答