Help - Search - Members - Calendar
Full Version: 10 most recent comments
Movable Type Community Forum > Additional Resources > Tips and Tricks
grizel
Ok I asked this before but it didn't work on an include sooooo I'll jujst ask again.

I want to add a block of the last ten comments (listed by wither poster name or name of the post commented on)

The thign is, my left side where I want it to go is an include. and it appears in the html before the MT code.

How can make this happen?

Could I instead add a link to the end each post called 'last 10" or soemthing, like the archive that will fire up a small pop up with the comment titles?

Kinda lost. Obvious eh?
phil4
I've not seen your previous post, so I may be restating the obvious.

If you left hand menu is part of the MT template, which you can edit, then you shouldn't have any real problems including what you want.... just drop something like the following where you want it, and then plant some HTML around it:

CODE
<MTEntries recently_commented_on="10">
<a href="<$MTEntryLink$>"><$MTEntryTitle$> (<$MTEntryCommentCount$>)<MTComments lastn="1"></a> - <$MTCommentBody></MTComments>..."<br />
</MTEntries>


Now if I've misunderstood you, I apologise... just thought I'd better cover the obvious in case someone's not already suggested it.
grizel
No my left side bar include is BEFORE the MT code. I did the above and it didn't work. At this point I just wouldn't mind a link that says 10 most recent comments and then it pops up or goes to a new pages where they are listed.
phil4
In which case I can think of two possible solutions.

1) Rewrite your site so that the left bar is included in your MT template.  It shouldn't matter that it's before the bulk of the MT code.

or

2) Create a template within MT for just the comments section, then use an HTML include to include that in a box, or as a pop-up.  
CODE
<!--#INCLUDE file.htm -->
 should do it.  And the template will use the code chunk in the previous post.
Muddy
I edited that code a little for my site, here is what I ended up with.

CODE
<MTEntries recently_commented_on="10">
<a href="<$MTEntryLink$>"><$MTEntryTitle$> (<$MTEntryCommentCount$>)
<MTComments lastn="1"></a> - <$MTCommentBody>
Posted by <$MTCommentAuthorLink spam_protect="1"$> at <$MTCommentDate$></MTComments>..."<br />
<hr align="right" width="200" style="margin-right: 15%;">
</MTEntries>


you can see it in action here muddysmind.com

I'm wondering if there is a way to limit how much of each comment is displayed.. I'd like to say put a 15 word limit that way you get the general idea what the comment is about.
stepan
Just to be clear,
CODE
<MTEntries recently_commented_on="10"
does not list the "Last 10 Comments" for your blog.  For that you'd need to use
CODE
<MTComments lastn="10">
instead (check the manual).  Conside what happens when there are more than one "most recent" comments for a particular entry.

As far as limiting the length of the comment excerpt, you can use the FirstNWords plugin.  Though I sure wish that were built-in...
dyoung
Speaking of this...

Is there a way to get it to sort the entries by which has been commented on most recently?

For example - something like

CODE
<MTEntries recently_commented_on="6" sort_by="commented_on">


??

Thanks,

david,
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.