多种标签调用方法实现网站栏目、下级栏目以及子栏目内文章的调用
一、栏目调用
方法1:
{eyou:channel type=’top’typeid=”currentstyle=’active’}
<li class=”{$field.currentstyle}”><a href='{$field.typeurl}’>{$field.typename}</a></li>
{/eyou:channel}
方法2:
{eyou:channelartlist typeid=”type=’top’}
<a href='{eyou:field%20name=’typeurl’/}’>{eyou:field name=’typename’/}</a>
{/eyou:channelartlist}
方法3:此方法必须指定栏目id进行调用
{eyou:type typeid=’1’empty=’暂时没有数据’}
<a href=”{$field.typeurl}” rel=”external nofollow” rel=”external nofollow” >{$field.typename}</a>
{/eyou:type}
二、下(子)级栏目调用
方法1:
{eyou:channelartlist typeid=”}
{eyou:channel type=’son’currentstyle=’active’}
<li class=”{$field.currentstyle}”><a href='{$field.typeurl}’>{$field.typename}</a></li>
{/eyou:channel}
{/eyou:channelartlist}
方法2:此方法必须指定栏目id进行调用,调用多个栏目时id用“,”号隔开
{eyou:channel type=’son’typeid=’1,2,3,4′:currentstyle=’active’}
<li class=”{$field.currentstyle}”><a href='{$field.typeurl}’>{$field.typename}</a></li>
{/eyou:channel}
三、调用子栏目文章
综合上面栏目和子栏目的调用方法
{eyou:channelartlist typeid=”}
–调用栏目名称–
<div class=”left_title1″>{eyou:field name=’typename’/}</div>
<div class=”left_nav_box”>
<ul class=”left_nav”>
–调用子栏目名称–
{eyou:channel row=”6″type=’son’}
<li><a href=”{$field.typeurl}” rel=”external nofollow” rel=”external nofollow” title=”{$field.typename}”>{$field.typename}</a></li>
{/eyou:channel}
</ul>
<a href=”{eyou:field%20name=’typeurl’/}” rel=”external nofollow” class=”left_more1″title=”查看更多分类”>查看更多分类</a></div>
<ul class=”right_pro”>
–调用子栏目下的文章–
{eyou:arclist row=’6’titlelen=’30’}
<li><a href=”{$field.arcurl}” rel=”external nofollow” rel=”external nofollow” title=”{$field.title}”><img src=”{$field.litpic}”width=”231″height=”173″alt=”{$field.title}”class=”PicAuto”/></a>
<p><a href=”{$field.arcurl}” rel=”external nofollow” rel=”external nofollow” title=”{$field.title}”>{$field.title}</a></p>
</li>
{/eyou:arclist}
</ul>
{/eyou:channelartlist}
</div>
注:如果需要调用指定栏目、子栏目及子栏目下的文章,只需在typeid=”里填上对应栏目id即可
文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/115526.html<