mattjfox

Having a problem showing multiple comments on an entry

Vote 0 Votes

For some reason I cannot display more than one comment at a time on an entry. I never noticed because sad enough to say I never got more than one comment on any of my blog postings, but I finally did and was dissapointed to see it was not visible.

It has been a while since I set up my MT Blog and I cannot remember much about the tags and how they work. I looked in the Comment Entry Template and tried a few things but no luck.

MT knows their are 2 comments because it says it in the comment header, it uses the plural verbiage instead of the singular and says 2 comments.

It shows the first comment and the user information who posted.

The second comment does not show, however it does show the user information. I was thinking there must be some kind of a loop statement missing to iterate through the comments, but I cannot find anything that would resemble a loop in the code.

Here is a link to the entry in question...

http://www.wikisoftpeople.com/blog/2010/01/how-did-bach-write-music.html

Here is the code being used for comments.

<mt:Ignore>
<!-- Display comments for the entry/page or commenting form if entry/page is accepting comments -->
</mt:Ignore>
<mt:IfCommentsActive>
<div id="comments" class="comments">


<mt:Ignore>
<!-- Display comments -->
</mt:Ignore>
<mt:Comments>

&nbsp;<mt:CommentsHeader>
<h2 class="comments-header"><$mt:EntryCommentCount singular="1 Comment" plural="# Comments" none="No Comments"$></h2>
<div class="comments-content">
<div class="comment-content">
<$mt:CommentBody$>
</mt:CommentsHeader> </div>
<div id="comment-<$mt:CommentID$>" class="comment<mt:IfCommentParent> comment-reply</mt:IfCommentParent><mt:IfCommenterIsEntryAuthor> entry-author-comment</mt:IfCommenterIsEntryAuthor>">
<div class="inner">
<div class="comment-header">
<div class="asset-meta">
<span class="byline">
<$mt:CommentAuthorIdentity$>

<mt:IfCommentParent>
<span class="vcard author"><$mt:CommentAuthorLink$></span> replied to <a href="<mt:CommentParent><$mt:CommentLink$></mt:CommentParent>">comment from <mt:CommentParent><$mt:CommentAuthor$></mt:CommentParent></a>
<mt:Else>
<span class="vcard author"><$mt:CommentAuthorLink$></span>
</mt:IfCommentParent>
| <a href="<$mt:CommentLink$>"><abbr class="published" title="<$mt:CommentDate format_name="iso8601"$>"><$mt:CommentDate$></abbr></a>
<mt:IfCommentsAccepted>
| <$mt:CommentReplyToLink$>
</mt:IfCommentsAccepted>
</span>
</div>
</div>

</div>
</div>
<mt:CommentsFooter>
</div>
</mt:CommentsFooter>
</mt:Comments>


<mt:Ignore>
<!-- Display commenting form if entry/page is accepting comments -->
</mt:Ignore>
<mt:IfCommentsAccepted>
<div class="comments-open" id="comments-open">
<h2 class="comments-open-header">Leave a comment</h2>
<div class="comments-open-content">

<mt:Ignore>
<!-- Display greeting for users if blog allows users to register locally -->
</mt:Ignore>
<div id="comment-greeting"></div>

<form method="post" action="<$mt:CGIPath$><$mt:CommentScript$>" name="comments_form" id="comments-form" onsubmit="return mtCommentOnSubmit(this)">
<input type="hidden" name="static" value="1" />
<input type="hidden" name="entry_id" value="<$mt:EntryID$>" />
<input type="hidden" name="__lang" value="<$mt:BlogLanguage$>" />
<input type="hidden" name="parent_id" value="<$mt:CommentParentID escape="html"$>" id="comment-parent-id" />
<input type="hidden" name="armor" value="1" />
<input type="hidden" name="preview" value="" />
<input type="hidden" name="sid" value="" />
<div id="comments-open-data">
<div id="comment-form-name">
<label for="comment-author">Name</label>
<input id="comment-author" name="author" size="30" value="" onfocus="mtCommentFormOnFocus()" />
</div>
<div id="comment-form-email">
<label for="comment-email">Email Address</label>
<input id="comment-email" name="email" size="30" value="" onfocus="mtCommentFormOnFocus()" />
</div>
<div id="comment-form-url">
<label for="comment-url">URL</label>
<input id="comment-url" name="url" size="30" value="" onfocus="mtCommentFormOnFocus()" />
</div>
<div id="comment-form-remember-me">
<input type="checkbox" id="comment-bake-cookie" name="bakecookie" onclick="mtRememberMeOnClick(this)" value="1" accesskey="r" />
<label for="comment-bake-cookie">Remember personal info?</label>
</div>
</div>
<div id="comment-form-reply" style="display:none">
<input type="checkbox" id="comment-reply" name="comment_reply" value="" onclick="mtSetCommentParentID()" />
<label for="comment-reply" id="comment-reply-label"></label>
</div>
<div id="comments-open-text">
<label for="comment-text">Comments
<mt:IfAllowCommentHTML>(You may use HTML tags for style)</mt:IfAllowCommentHTML></label>
<textarea id="comment-text" name="text" rows="15" cols="50" onfocus="mtCommentFormOnFocus()"></textarea>
</div>
<div id="comments-open-captcha"></div>
<div id="comments-open-footer">
<input type="submit" accesskey="v" name="preview_button" id="comment-preview" value="Preview" onclick="this.form.preview.value='1';" />
<input type="submit" accesskey="s" name="post" id="comment-submit" value="Submit" />
</div>
</form>


</div>
</div>
<script type="text/javascript">
<!--
mtAttachEvent("load", mtEntryOnLoad);
mtAttachEvent("unload", mtEntryOnUnload);
//-->
</script>
</mt:IfCommentsAccepted>


</div>
</mt:IfCommentsActive>

Reported on Movable Type 4.25

3 Replies

| Add a Reply
  • I see that you have the CommentBody tag in the CommentsHeader block. Look at the documentation for CommentsHeader. Whatever is put inside the CommentsHeader block will only display once, meaning if you have multiple comments, that tag only displays for the first comment. It is usually used to set up things like the opening div or opening ul etcetera.

    The CommentsFooter works the same way, but only activates with the last comment.

  • mattjfox

    Ahah! Thank you! That did it.

  • I also learn many things from the above and thanks for sharing it with all of us.

    boca raton attorney

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

code.sixapart.com

141 495

Last Topic: Action Stream for LinkedIn by michael webster on Jan 10, 2013

250 890

Last Topic: From Word to WYSIWYG by ngsk on Mar 4, 2013

1884 6659

Last Topic: Note to New Users and Template Changes by Chelle on Mar 5, 2013

91 315

Last Topic: Seeking explanation of files and folders by CosmicKnight on Feb 23, 2013

1537 5500

Last Topic: 301 redirect for entire site - by afinta on Mar 12, 2013

90 328

Last Topic: HELP! I need to 301 over 100 urls on my site via htaccess by justin on Feb 22, 2013

193 796

Last Topic: error loading WYSIWYG Editor by thiago on Feb 9, 2013

219 707

Last Topic: Zemanta Plugin vs. Browser Extension by Chelle on Feb 22, 2013

28 96

Last Topic: Movable Price by joe22 on Jan 10, 2013

50 218

Last Topic: Ability to flag/report comments by Android on Feb 22, 2013

65 249

Last Topic: Expanding new rich text editor and implementing table function by Takeshi Nick Osanai on Jul 30, 2012