易優CMS欄目標簽大全
2020-04-20
1、如何獲取頂級欄目(名稱,鏈接,英文名稱)
頂級欄目名稱代碼“{$eyou.field.typeid|gettoptype=###,'typename'}”
頂級欄目鏈接代碼“{$eyou.field.typeid|gettoptype=###,'typeurl'}”
頂級欄目英文名稱代碼“{$eyou.field.typeid|gettoptype=###,'englist_name'}”
頂級欄目圖片代碼 “{$eyou.field.typeid|gettoptype=###,'litpic'}“
2、三級欄目如何獲取上級(第二級)欄目名稱和鏈接
上級欄目ID:{$eyou.field.ptypeid}
上級欄目鏈接:{$eyou.field.ptypeurl}
上級欄目名稱:{$eyou.field.ptypename}
3、欄目列表是否有下級欄目的判斷
{eyou:if condition='($eyou.field.has_children > 0)'}
當前欄目列表有下級欄目
{eyou:else /}
當前欄目列表沒有下級欄目
{/eyou:if}
4、三級分類,在三級欄目頁下,各級顯示焦點。
二級欄目顯示當前焦點代碼:
{eyou:channel type="first" currentstyle="active"}
{eyou:eq name='$eyou.field.grade' value='2'}
{eyou:type typeid='$eyou.field.typeid' id='field1'}
{eyou:eq name='$field1.parent_id' value='$field.id'}
{eyou:assign name='$field.currentstyle' value='active' /}
{/eyou:eq}
{/eyou:type}
{/eyou:eq}
<li>
<a href="{$field.typeurl}" class="{$field.currentstyle}">{$field.typename}</a>
</li>
{/eyou:channel}三級欄目顯示焦點代碼:
{eyou:channel type='sonself' currentstyle="active"}
<li>
<a href="{$field.typeurl}" title="{$field.typename}" class="{$field.currentstyle}">{$field.typename}</a>
</li>
{/eyou:channel}5、下級欄目內容頁調用頂級欄目圖片
{eyou:channelartlist typeid='$eyou.field.ptypeid'}
{eyou:field name='litpic' /}
{/eyou:channelartlist}







