Help - Search - Members - Calendar
Full Version: CommentCount on Main Archive page
Movable Type Community Forum > Additional Resources > Tips and Tricks
vacuity
Hi, I'd like to add the commentcount-feature to my archive-template, but for some reason I do not get it fixed. It always tells me I'm using it outside of an mtentry-tag. When I write

MTArchiveEntryCommentCount

then it does save the template, but nothing shows up on my site. Could you please tell me how I can solve the problem?
bmk
Try MTEntryCommentCount?
vacuity
If it were so easy I'd use that. But that tag doesn't work in that case.

This is the script I'm using for my archive:


CODE
<div id="container">
<div class="blogbody">
<font color="99CCCC"><b>2003</b></font>

<MTArchiveList><$MTEntryDate format="%B %d ..."$> <a href="<$MTArchiveLink$>"><$MTArchiveTitle$></a><br>
</MTArchiveList>

</div>
</div>
kadyellebee
Try
CODE
<$MTArchiveCount$>

and the MTEntryDate probably should be
CODE
<$MTArchiveDate$>
for it to work in that context smile.gif

Kristine
vacuity
Thank you, kadyellebee, for the suggestion. I've tried that out, but it doesn't work, too. I'd like to show the number of comments made in each entry in the line behind the link for each individual entry.

But what I get through

CODE
<$MTArchiveCount$>


is that it shows only 1's after each entry, counting the number of archives I have, I guess.

I tried

CODE
<$MTArchiveCommentCount$>


but I guess that kind of tag doesn't exist.
AMK4
I use a plugin called MTEntryIfComments available at mt-plugins.

It allows you to do some fancy stuff with the tag, like what I do:

CODE
<MTEntryIfAllowComments>
    <MTEntryIfComments count_equals="0">No comments.  Why not <a href="<$MTCGIPath$><$MTCommentScript$>?entry_id=<$MTEntryID$>" onclick="OpenComments(this.href); return false">post one</a>?
    </MTEntryIfComments>

    <MTEntryIfComments count_equals="1">
1 comment.  <a href="<$MTCGIPath$><$MTCommentScript$>?entry_id=<$MTEntryID$>" onclick="OpenComments(this.href); return false">Read or post another</a>.
    </MTEntryIfComments>

    <MTEntryIfComments count_greater_than="1">
    <MTEntryCommentCount> comments.  <a href="<$MTCGIPath$><$MTCommentScript$>?entry_id=<$MTEntryID$>" onclick="OpenComments(this.href); return false">Read or post more</a>.
    </MTEntryIfComments>
    </MTEntryIfAllowComments>


This will give you:

CODE
'No comments. Why not post one?', or
'1 comment. Read or post another.', or
'5 comments. Read or post more.'
girlie
Hmm. Is that what he's trying to do?? I don't quite think that is what he means.

Back to what Brenna (BMK) said: MTEntryCommentCount. This tag provides the number of comments on an entry. If it's not working, we need to take a closer look at how you're using it.

If you're only sticking it in an MTArchiveList, it's not going to work - you need an MTEntries container in there (That's why you're getting the error message about MTEntries! Are you sure that MTEntryDate tag is even working?).

CODE
<MTArchiveList>
<a href="<$MTArchiveLink$>"><$MTArchiveTitle$></a><br>
<MTEntries>
<$MTEntryDate format="%B %d ..."$> <MTEntryCommentCount>
</MTEntries>
</MTArchiveList>


although, I'm not really sure how to give you a code sample, since I don't know what you're trying to do with that MTArchiveList tag.
AMK4
QUOTE (girlie @ May 29 2003, 11:08 PM)
Hmm. Is that what he's trying to do?? I don't quite think that is what he means.

It gets the count *e needs, no? If not, then I'm cornfuzzled too.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.