在使用易優cms時,遇到欄目頁或者內容頁二級欄目導航和三級欄目導航分開調用時,標籤如何調用呢?先在公用函數文件里加一截代碼,。php
公用函數文件\extend\function.php打開後在底部添加下面代碼
/**html
if (2 == $max_level) {
return $str;
} else {
return '';
}
}
而後下面時模板使用代碼,注意樣式文件本身修改
<div class="pagelinks">
<ul >ide
<!--獲取二級欄目開始--> {eyou:channel type="first" currentstyle="on" id='field'} <!--有三級時判斷二級欄目高亮開始--> {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='on' /} <!--標籤value='on'裏面的on是高亮輸出樣式--> {/eyou:eq} {/eyou:type} {/eyou:eq} <!--有三級時判斷二級欄目高亮結束--> <li> <a href="{$field.typeurl}" class="{$field.currentstyle}"> <span class="iconfont icon-{$field.tubiao}" style="font-size:50px;"></span><br> <span style="font-size:15px;">{$field.typename}</span> </a> </li> {/eyou:channel} <!--獲取二級欄目結束--> </ul>
</div>
<div class="titles">
<ul>函數
<!--獲取三級欄目開始--> <!--判斷開始--> {eyou:eq name='$eyou.field.grade' value='2'} <!--有三級欄目輸出開始--> {eyou:channel type="sonself" currentstyle="cur" id='field2'} <li class="{$field2.currentstyle}"><a href="{$field2.typeurl}">{$field2.typename}</a></li> {/eyou:channel} <!--有三級欄目輸出結束--> {eyou:else /}<!--判斷--> <!--沒有三級欄目輸出開始--> {eyou:channel type="son" currentstyle="cur" id='field2'} <li class="{$field2.currentstyle}"><a href="{$field2.typeurl}">{$field2.typename}</a></li> {/eyou:channel} <!--沒有三級欄目輸出結束--> {/eyou:eq} <!--判斷結束--> <!--獲取三級欄目結束--> </ul>
</div>url