【基礎用法】
名稱:if
功能:條件判斷,比switch判斷標簽更靈活些,視個人習慣而用。
語法:
{eyou:if condition='($eyou.field.has\_children > 0)'}
當前欄目列表有下級欄目
{eyou:else /}
當前欄目列表沒有下級欄目
{/eyou:if}
文件:
無
參數:
condition='' 原生php語法條件判斷
底層字段:
無
?
【更多示例】
\-------------------------------示例1--------------------------------
描述:多層次判斷
{eyou:if condition='($eyou.field.has\_children == 1)'}
當前欄目列表的欄目ID有1個下級欄目
{eyou:elseif condition='($eyou.field.has\_children == 2)' /}
當前欄目列表的欄目ID有2個下級欄目
{eyou:else /}
當前欄目列表的欄目ID有N個下級欄目
{/eyou:if}
\-------------------------------示例2--------------------------------
描述:if標簽之間嵌套
{eyou:if condition='($eyou.field.has\_children > 0)'}
> {eyou:if condition='($eyou.field.has\_children == 1)'}
> 當前欄目列表的欄目ID有1個下級欄目
> {eyou:elseif condition='($eyou.field.has\_children == 2)' /}
> 當前欄目列表的欄目ID有2個下級欄目
> {eyou:else /}
> 當前欄目列表的欄目ID有N個下級欄目
> {/eyou:if}
{/eyou:if}
- 準備工作
- 全局標簽
- Global全局配置標簽
- Arclist文檔列表
- Channel獲取欄目列表
- Channelartlist 當前頻道+循環
- Type指定欄目及內容
- Include 引用模板文件
- Arcview單條文檔數據
- Position面包屑
- Assign模板文件中定義變量
- Empty判斷變量是否為空
- Notempty判斷變量不為空
- Foreach數據/記錄循環輸出
- Volist數據/記錄循環輸出
- If條件判斷
- Switch簡單條件判斷
- Compare變量比較
- Ad廣告標簽
- Load資源文件加載
- Field獲取channelartlist標簽里的字段值
- Tag調用
- Searchform搜索標簽
- 標簽常用函數
- Flink友情鏈接
- Weapp網站插件
- Range范圍判斷標簽
- For數據循環輸出
- Ad單條廣告調用
- Attribute欄目屬性列表
- User登錄注冊標簽
- 列表標簽
- List列表數據標簽
- Pagelist列表分頁
- Arcpagelist 瀑布流分頁列表
- Screening篩選標簽
- 內容標簽
- Arcclick文檔瀏覽量
- Guestbookform留言表單
- Prenext上一篇下一篇
- 裝修標簽
- 多語言標簽
- Language多語言列表
- Lang語言包變量