易優CMS:channelartlist 獲取當前頻道的下級欄目的內容列表

channelartlist 獲取當前頻道的下級欄目的內容列表
 
[基礎用法]
名稱:channelartlist
功能:獲取當前頻道的下級欄目的內容列表標籤
語法:
{eyou:channelartlist typeid='欄目ID' type='son' row='20'}
<a href='{eyou:field name='typeurl' /}'>{eyou:field name='typename' /}</a>
{eyou:arclist limit='0,10' titlelen='30'}
<a href='{$field.arcurl}'>{$field.title}</a>
{/eyou:arclist}
{/eyou:channelartlist}
 
參數:
typeid='' 欄目ID,多個請用","分開
row='100' 調用欄目數
titlelen='30' 欄目名稱長度
type='son' 表示下級欄目
  • type='self' 表示同級欄目
  • type='top' 表示頂級欄目
  • type='sonself' 表示當前下級欄目以及同級欄目
mod='' 每隔N行輸出的內容
empty='' 沒有數據時顯示的文案
底層字段:
請查閱易優Cms官方提供的數據字典,找到表名 ey_arctype
 
-------------------------------效果展現--------------------------------
1,調用指定欄目ID,(欄目名稱連接,子欄目名稱連接,欄目內文章)
模板調用代碼
<div> 
{eyou:channelartlist typeid='2'}
  <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}" title="{$field.typename}">{$field.typename}</a></li>
      {/eyou:channel}
    </ul>
    <a href="{eyou:field name='typeurl' /}" class="left_more1" title="查看更多分類">查看更多分類</a> </div>
  <ul class="right_pro">
    {eyou:arclist row='6' titlelen='30'}
    <li> <a href="{$field.arcurl}" title="{$field.title}"><img src="{$field.litpic}" width="231" height="173" alt="{$field.title}" class="PicAuto"/></a>
      <p><a href="{$field.arcurl}" title="{$field.title}">{$field.title}</a></p>
    </li>
    {/eyou:arclist}
  </ul>
  {/eyou:channelartlist} 
  </div>
 
網站前端顯示效果(css樣式請自行填充)


 
【更多示例】
-------------------------------示例1--------------------------------
描述:輸出頂級欄目列表
{eyou:channelartlist type='top' row='10'}
<a href="{eyou:field name='typeurl' /}">{eyou:field name='typename' /}</a>
{/eyou:channelartlist}
-------------------------------示例2--------------------------------
描述:輸出指定欄目下的內容列表(channelartlist標籤裏嵌套arclist標籤)
{eyou:channelartlist typeid='10,11,12' row="10"}
{eyou:arclist row='10' titlelen='30' infolen='160'}
<a href='{$field.arcurl}'>{$field.title}</a>
{/eyou:arclist}
{/eyou:channelartlist}
-------------------------------示例3--------------------------------
描述:輸出指定欄目下的下級欄目的內容列表(channelartlist標籤裏嵌套arclist標籤)
{eyou:channelartlist typeid='欄目ID' type='son' row="10"}
{eyou:arclist row='10' titlelen='30' infolen='160'}
<a href='{$field.arcurl}'>{$field.title}</a>
{/eyou:arclist}
{/eyou:channelartlist}
-------------------------------示例4--------------------------------
描述:輸出指定欄目下的下級欄目列表(channelartlist標籤裏嵌套channel標籤)
{eyou:channelartlist typeid='欄目ID' type='son' row='10'}
{eyou:channel type='son' row='10' currentstyle='active'}
<a href="{$field.typeurl}" title="{$field.typename}" class="{$field.currentstyle}">{$field.typename}</a>
{/eyou:channel}
{/eyou:channelartlist}
-------------------------------示例5--------------------------------
描述:輸出指定欄目下的下級欄目列表(channelartlist標籤裏嵌套type標籤)
{eyou:channelartlist typeid='欄目ID' type='son' row='10'}
{eyou:type type='self'}
<a href="{$field.typeurl}" title="{$field.typename}">{$field.typename}</a>
{/eyou:type}
{/eyou:channelartlist}
文章來源:https://www.eyoucms.com/zanzanEY/
相關文章
相關標籤/搜索