Help - Search - Members - Calendar
Full Version: SimpleComments
Movable Type Community Forum > Additional Resources > Tips and Tricks
ibergus
Hello,

I would like to add a "recent comments" to the side bar of my blog but I don't know how to do it. I suppose I need to use SimpleComments. Is there a simple way to do it? I already installed the Plugin Manager (do I need it at all?)

Thanks,

Isaac
girlie
You don't need a plugin to do this.

You can either use <MTEntries> with the recently_commented_on attribute:

QUOTE
recently_commented_on="N"
Display the N most recently commented-on entries. Each entry will appear in the list only once, so if, for example, a comment is posted to Entry A, then a comment to Entry B, then another to Entry A, there will be two entries displayed: Entry A, then Entry B.


or use the <MTComments> tag:

QUOTE
MTComments
A container tag representing a list of comments, either on a particular entry or in a particular weblog (depending on the presence of the lastn attribute, below).

If you provide this tag with the lastn="N" attribute, where N is the number of comments you would like displayed, it will list either the N most recent comments on the particular entry--if used in entry context--or the N most recent comments in your weblog, if used elsewhere.


Both of these are found in the manual on Template Tags.
ibergus
OK, but now I see the whole comments on the side bar.

How can I configure it so that I see the first two lines and the name of the author of each comment?
girlie
You can either use the trim_to attribute to get a certain number of characters:
CODE
<MTCommentBody trim_to="50">


Or use a plugin like FirstNWords to get a certain number of words.

Or limit the excerpt to a paragraph.
ibergus
Thanks a lot for the help.

One more question, is there any good reference about MT plug-in programming? MovableType's manual is not didactical enough to my taste (and background knowledge).

Isaac
stepan
The Developing Movable Type Plug-ins article is a great start. You may also need the API reference for more complex stuff.

In general, you should start to look for a solution in the MT Plugin Directory, you might find something close and then modify it to fit your needs (making sure, of course, that it doesn't violate the author's license). In any case, you can learn a lot by looking at other people's code.
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.