テンプレート・モジュール : comment-form
コメント投稿用のフォームです。
自分でテンプレート・モジュールを作成する場合は、この標準モジュールをベースに、カスタマイズをするのが楽です。モジュールを作成したら、『新しくテンプレート・モジュールを作成』をクリックして、名前( comment-form )をつけて保存します。作成したモジュールは、以下のように記述することで、他のテンプレートで読み込むことができます。
- <$MTInclude module="comment-form"$>
関連モジュール・テンプレート
- 利用元テンプレート
このモジュールを利用しているテンプレートあるいはモジュールの一覧です。テンプレート名をクリックすると、内容を表示します。
テンプレートの内容
<!-- comment form -->
<MTEntryIfCommentsOpen>
<script type="text/javascript" src="<$MTStaticWebPath$>js/comments.js"></script>
<script type="text/javascript">hostName = '<$MTBlogHost$>';</script>
<form id="comment-form"
method="post" action="<$MTCGIPath$><$MTCommentScript$>">
<input type="hidden" name="entry_id" value="<$MTEntryID$>" />
<input type="hidden" name="user_id" value="<$MTUserID>" />
<div class="comments-open">
<h2 class="comments-open-header"><$MTTrans phrase="Post a comment"$></h2>
<div class="comments-open-content">
<MTWeblogIfCommentsModerated>
<p class="comments-open-moderated">
<$MTTrans phrase="Comments are moderated, and will not appear on this weblog until the author has approved them."$>
</p>
</MTWeblogIfCommentsModerated>
<MTWeblogIfRegistrationEnabled>
<script type="text/javascript" src="<$MTCGIPath$><$MTCommentScript$>?__mode=check_login"></script>
<script type="text/javascript">
checkLocal();
</script>
<p id="comments-open-login" style="display: block;">
<MTWeblogIfRegistrationRequired>
<$MTTrans phrase="This weblog only allows comments from registered users."$>
<$MTTrans phrase="To comment, please"$>
<a href="<$MTEntrySignInURL$>"><$MTTrans phrase="Sign In"$></a>.
<MTElse>
<$MTTrans phrase="If you have a TypeKey or TypePad account, please"$>
<a href="<$MTEntrySignInURL$>"><$MTTrans phrase="Sign In"$></a>
</MTElse>
</MTWeblogIfRegistrationRequired>
</p>
<p id="comments-open-logout" style="display: none;">
<$MTTrans phrase="You are currently signed in as"$>
<span id="commenter-name">(nobody)</span>.
<a href="<$MTEntrySignOutURL$>"><$MTTrans phrase="Sign Out"$></a>
</p>
</MTWeblogIfRegistrationEnabled>
<MTWeblogIfRegistrationRequired>
<MTElse>
<div id="comments-open-data">
<p>
<label for="comment-author"><$MTTrans phrase="Name:"$></label>
<input id="comment-author" name="author" size="30" />
</p>
<p>
<label for="comment-email"><$MTTrans phrase="Email Address:"$> <span class="comment-form-note"><$MTTrans phrase="(Not displayed with comment.)"$></span></label>
<input id="comment-email" name="email" size="30" />
</p>
<p>
<label for="comment-url"><$MTTrans phrase="URL:"$></label>
<input id="comment-url" name="url" size="30" />
</p>
<p>
<label for="comment-bake-cookie"><input type="checkbox"
id="comment-bake-cookie" name="bakecookie" value="1" />
<$MTTrans phrase="Remember personal info?"$></label>
</p>
</div>
</MTElse>
</MTWeblogIfRegistrationRequired>
<MTWeblogIfRegistrationRequired>
<p id="comments-open-text" style="display: none;">
<MTElse>
<p id="comments-open-text">
</MTElse>
</MTWeblogIfRegistrationRequired>
<label for="comment-text"><$MTTrans phrase="Comments:"$><$MTWeblogIncludeModule module="comment-emoticon"$></label>
<textarea id="comment-text" name="text" rows="10" cols="30" onkeyup="maxTextarea(this, 64000)"></textarea>
</p>
</div>
<MTWeblogIfRegistrationRequired>
<div id="comments-open-footer" class="comments-open-footer" style="display: none;">
<MTElse>
<div id="comments-open-footer" class="comments-open-footer">
</MTElse>
</MTWeblogIfRegistrationRequired>
<input type="submit" name="preview" id="comment-preview" value=" <$MTTrans phrase="Preview"$> " />
<input type="submit" name="post" id="comment-post" value=" <$MTTrans phrase="_POST_VERB"$> " onclick="disableButton(this);return false;" />
</div>
</div>
</form>
<MTWeblogIfRegistrationEnabled>
<script type="text/javascript">
commentSignIn();
</script>
</MTWeblogIfRegistrationEnabled>
</MTEntryIfCommentsOpen>
<MTEntryIfCommentsOpen>
<MTElse>
<p class="comments-closed">
<$MTTrans phrase="The comments to this entry are closed."$>
</p>
</MTElse>
</MTEntryIfCommentsOpen>
[ テンプレート一覧に戻る ] [ モジュール一覧に戻る ]