MovableTypeで変数の値で条件分岐

| | Comments (0) | TrackBacks (0)
次の例では、<$SampleImage$>があるかないかで、出力する内容を分岐させる例である。


<MTIfNonEmpty tag="SampleImage">
<img src="<$SampleImage$>" alt="" width="32" />
<MTElse>
<img src="/noimage.gif" alt="" width="32" />
</MTElse>
</MTIfNonEmpty>


MTIfNonEmpty はtagに与えた変数が空であるかどうかを判断し、"空である場合"に処理を続ける。また、
MTElseで"空の場合"の処理を記述できる。

0 TrackBacks

Listed below are links to blogs that reference this entry: MovableTypeで変数の値で条件分岐.

TrackBack URL for this entry: http://mahata.net/movabletype/mt-tb.cgi/2977

Leave a comment

About this Entry

This page contains a single entry by mahata published on October 3, 2007 3:42 PM.

拡張子が.phpのファイルでxml宣言を記述する方法 was the previous entry in this blog.

google-code-prettifyでソースコードのシンタックスハイライト is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.