MTでダイナミックパブリッシング用の条件タグを実装

| | Comments (0) | TrackBacks (1)

MT3系(たぶん4系でもそのまま使える)のダイナミックパブリッシング用の条件タグの実装方法を次にメモする。
まず、下記のテンプレートは『MovableType上級カスタマイズ術』からの引用である。

<?php
function smarty_block_条件タグ($args, $content, &$ctx, &$repeat) {
    if( $issset($content) ) {
        // 条件判断処理
        return $ctx->_hdlr_if($args, $content, $ctx, $repeat, $retcode);
    } else {
        return $ctx->_hdlr_if($args, $content, $ctx, $repeat);
    }
}
?>

これだと$argsにMTの変数を渡せないけど、どうすればいいのかわからない。

[追記]

結論から言うと、MTの変数は渡せないものらしい。
MTの変数を渡したい場合は、MTTagInvokeを使用するのが定番のよう。

ブログ自由自在 Movable Type 上級カスタマイズ術
藤本 壱
技術評論社 (2005/05/18)
売り上げランキング: 171710
おすすめ度の平均: 4.0
5 MT初心者にはチョットハードルたかいかも?
1 メタタグが変わってしまってこの本は使えない
5 中上級者なら MT の入門からマスターまでこの1冊で OK!

1 TrackBacks

Listed below are links to blogs that reference this entry: MTでダイナミックパブリッシング用の条件タグを実装.

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

xanax online from xanax online on January 6, 2008 1:30 PM

news Read More

Leave a comment

About this Entry

This page contains a single entry by mahata published on October 5, 2007 7:50 PM.

ドラフト会議 was the previous entry in this blog.

東京マラソン → 青梅マラソン is the next entry in this blog.

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