微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

phpcms频道首页调用所有一级栏目及二级栏目

关键字描述:栏目 一级 二级 所有 调用 频道 首页 < " > width

打开PHPcms频道首页模板index.html
你会看到:

CODE: [copy to clipboard] <!--自定义栏目开始-->
<table width=100% cellspacing=0 cellpadding=0>
{loop $childcats $i $cat}
{if $i%2==0}<tr>{/if}
<td valign=top style=padding:0 5px;>
<table width=100% cellspacing=0 cellpadding=0>
<tr>
<td class=titlebar width=100>{$cat[catname]}</td>
<td width=10 height=25><img src={$skindir}/images/tit3_r.jpg></td>
<td width=225 align=right class=bg_titlebar><a href={$cat[caturl]} class=more>更多</a>&nbsp;</td>
<td width=36><img src={$skindir}/images/tit2_r.jpg></td>
</tr>
</table>

{$articlelist(0,$channelid,$cat[catid],1,10,30,$cat[ordertype],2,$cat[target],1)}

</td>
{if $i%2==1}</tr>{/if}
{/loop}
</table>
<!--自定义栏目结束--> 把他换成

CODE: [copy to clipboard] <!--自定义栏目开始-->
<table width=100% cellspacing=0 cellpadding=0>
{loop $childcats $i $cat}
{if $i%2==0}<tr>{/if}
<td valign=top style=padding:0 5px;>
<table width=100% cellspacing=0 cellpadding=0>
<tr>
<td class=titlebar width=100>{$cat[catname]}</td>
<td width=10 height=25><img src={$skindir}/images/tit3_r.jpg></td>
<td width=225 align=right class=bg_titlebar><a href={$cat[caturl]} class=more>更多</a>&nbsp;</td>
<td width=36><img src={$skindir}/images/tit2_r.jpg></td>
</tr>
</table>

{loop get_childcat($channelid,$cat[catid]) $childid}
&nbsp;&nbsp;<a href={$childid[caturl]}>{$childid[catname]}</a>
{$articlelist(0,$childid[catid],36,$childcat[itemordertype],1)}
{/loop}
</td>
{if $i%2==1}</tr>{/if}
{/loop}
</table>
<!--自定义栏目结束--> 具体怎么做的美观点大家自由发挥了~~

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐