MTCommentCustomFields
コメント システムオブジェクトに追加した、カスタムフィールドを一覧で表示するブロックタグです。追加した全てのカスタムフィールドを表示します。include モディファイアに名前を指定したカスタムフィールドを表示します。exclude モディファイアに名前を指定したカスタムフィールドは表示しません。特定のカスタムフィールドだけを表示したいときは、個別のテンプレートタグを使用してください。
使い方
<mt:CommentCustomFields>
<ul>
<mt:IfNonEmpty tag="CommentCustomFieldValue">
<li><$mt:CommentCustomFieldName$>: <$mt:CommentCustomFieldValue$></li>
</mt:IfNonEmpty>
</ul>
</mt:CommentCustomFields>
入力フォーム表示する
コメントをカスタムフィールドで拡張した後に、実際にコメントを受付けるためには、ブログのコメント入力欄にフォームを追加する必要があります。以下のタグを、コメント投稿フォーム(<form></form>)内に記述することで、カスタムフィールド用のフォームを出力します。
<input type="hidden" name="blog_id" value="<MTBlogID>" />
<input type="hidden" name="customfield_beacon" value="1" id="customfield_beacon" />
<mt:CommentCustomFields>
<mt:SetVarBlock name="custom_field_name"><$mt:CustomFieldName$></mt:SetVarBlock>
<mt:SetVarBlock name="field-content"><$mt:CustomFieldHTML$></mt:SetVarBlock>
<mt:SetVarBlock name="custom_field_id">profile_<$mt:CustomFieldName dirify="1"$></mt:SetVarBlock>
<$mt:Include module="フォームフィールド" id="$custom_field_id" class="" label="$custom_field_name"$>
</mt:CommentCustomFields>
モディファイア
- include="フィールドの名前"
指定した名前のフィールドの情報を表示するようにします。
- exclude="フィールドの名前"
指定した名前のフィールドの情報を表示しないようにします。
Updated on 2010-07-26, 16:29 .

