Textpattern logo

Help?

if different (zh-tw)

From Textbook

(Redirected from Zh-tw/txp:if different)

Contents

類型

if_different條件式標籤,因為所有的條件式標籤皆為圍堵標籤,所以此標籤也是 圍堵標籤。若標籤範圍內的輸出內容有改變時,Textpattern 會執行範圍內的代碼。 可以在文章裡使用,如迴響模型及檔案模型。

語法

if_different 標籤的語法結構如下...

<txp:if_different>
  ...這段內容有改變時顯示...
<txp:else />
  ...預設顯示的內容...
</txp:if_different>

屬性

此標籤無屬性。


範例

範例 1: 在文章列表裡,每天顯示一次日期

Weblog

    <txp:if_different>
    <!-- 標題 - 一天顯示一次 -->
    <h3><txp:posted format="%d %B %Y" /></h3>
    </txp:if_different>

Translations [?]...

About Textbook