Movable Type features a built-in comment system. You can edit existing
comments by visiting the Comments area of your weblog, or you can
view those associated with a particular entry on the Edit Entry
screen for that entry. In either area, you can delete comments by
checking their checkboxes, then clicking DELETE CHECKED
.
The default templates that ship with Movable Type are comment-ready; in other words, you should be able to use comments in your weblog without editing any of the comment templates at all. The default templates are set up so that comments appear on both the popup comment window (linked from the Main Index template) and the individual archive pages. You can alter this behavior by altering the appropriate templates.
Movable Type's comment system can be used in either of two ways (or both):
<p><font class="title"><$MTEntryTitle$></font></p> <$MTEntryBody$> <MTComments> <$MTCommentBody$> <font class="post">Posted by <$MTCommentAuthorLink$>.</font><br><br> </MTComments>
In fact, the default Individual Entry Archive Template contains this same structure.
<MTComments> <$MTCommentBody$> <font class="post">Posted by <$MTCommentAuthorLink$>.</font><br><br> </MTComments>
The following Javascript function is used to link to the comment popup window:
<script type="text/javascript"> <!-- function OpenComments (c) { window.open(c, 'comments', 'width=480,height=480,scrollbars=yes,status=yes'); } //--> </script>
And the following code invokes the Javascript function:
<MTEntryIfAllowComments> <a href="<$MTCGIPath$><$MTCommentScript$>?entry_id=<$MTEntryID$>" onclick="OpenComments(this.href); return false">Comments (<$MTEntryCommentCount$>)</a> </MTEntryIfAllowComments>
Of course, in either of these scenarios, you will also want to provide a form for users to enter new comments. That form can look something like this:
<form method="post" action="<$MTCGIPath$><$MTCommentScript$>"> <input type="hidden" name="entry_id" value="<$MTEntryID$>"> Name: <input name="author"><p> Email Address: <input name="email"><p> URL: <input name="url"><p> Body: <textarea name="text" rows="10" cols="50"></textarea><p> <input type="submit" name="preview" value="PREVIEW"> <input type="submit" name="post" value="POST"> </form>
If you are using static/inline comments, note that the sample form above will require the addition of one more hidden input field:
<input type="hidden" name="static" value="1">
This tells the comments system that you are using inline comments, which will force a rebuild of the entry archives and of the index pages for your weblog, after a new comment is posted.
Note that in either scenario--inline comments or popup comments--your index
pages will be rebuilt after a new comment is added; this is to update the
count of the number of comments on the entry (see the MTEntryCommentCount
tag, in TEMPLATE TAGS). In addition, if you are using inline
comments, your archive pages for the entry will be rebuilt; this is to add
the new comment to your individual entry archive page for the entry.
Comment previews are built into Movable Type, so that your visitors can
preview their comments before posting. Support for previews ships with the
default templates built into the system; you can remove this support, if you
wish, by removing the PREVIEW
button from the comments form. The layout of
the comment previews is defined using the Comment Preview
template. You
can use the <$MTCommentPreview*$>
tags, along with the global tag
attribute encode_html
, to create an editable comment preview form; this
allows users to preview their comment, then edit the comment being previewed,
then post the comment. The default templates have an example of an editable
comment preview template.
When creating an editable comment preview template, you should always paste
this hidden input field into the forms in your Comment Preview
and
Comment Error
templates:
<input type="hidden" name="static" value="<$MTCommentPreviewIsStatic$>">
This is a magical tag that tells the system whether a user is posting a comment from your individual archives, or from the comment popup window, so that the user can be redirected to the proper page after posting a comment.
You can also list all of the previous comments posted to the entry, using the standard <MTComments> container tag:
Previous comments: <MTComments> <$MTCommentBody$> Posted by <$MTCommentAuthorLink$> at <$MTCommentDate$> </MTComments>
If an error occurs when a comment is submitted--for example, if you have
disallowed anonymous comments, and the user does not supply a name or email
address--you can customize the error page that the user receives using the
Comment Error Template
. You can use this template to provide a form where
users can fix whatever error has occurred in their submissions, then re-post
(or preview) the comment. The default templates have an example of a
Comment Error Template
( http://www.sixapart.com/movabletype/default_templates ).
Comments can be managed by clicking the ``COMMENTS'' button on the left-side menu of a weblog. This screen will display all the comments to your weblog in chronological order, and you can page through them. Beside each comment is a symbol that indicates whether the comment was placed by a registered commenter and, if so, what the commenter's status is. If it was placed by an unregistered commenter, it will indicate whether that comment is awaiting approval.
This screen also allows you to approve and reject commenters and to approve and reject moderated comments. These features are useful if you have enabled ``Allow comments from registered users'' or ``Moderate comments from unregistered users'' in your weblog configuration.
You can also check the checkbox next to one or more comments on this screen and delete them by clicking the ``Delete Comments'' button at the bottom of the screen.
When registered comments are allowed on your site, you have the option to approve each new commenter when she or he posts a first comment. Until you've approved a commenter, his or her comments will not be displayed on the weblog, but after approval, that user's comments will appear as soon as they are posted. This way, you can control the community of people who comment on your site, without managing each individual comment.
On the comment listing screen, you'll see colored buttons by each new registered commenter which allow you to ``Approve User'' or ``Ban User''. If you approve, all of that commenter's comments to date will appear on your weblog, and future comments will appear immediately. If you ``bane'', the commenter's comments to date will be deleted and future comments from that person will be disallowed.
Once you have approved or banned a commenter the first time, you still have the option to change that commenter's status later on. When you return to the comment listing screen, you'll see a button next to the commenter's name which will allow you to approve (or ban) future comments from that person. Once the user has been approved or banned the first time, clicking ``approve'' or ``ban'' doesn't affect any comments to date; it only affects whether that account is allowed to post in the future.
Registered commenters are also listed in the Commenters area of your weblog. You can always approve or ban a commenter through this screen, even if there are no comments associated with that commenter.
If you enable unregistered comments for your weblog, you may still wish to have some control over the comments that are posted. Comment moderation means that comments won't appear on the site until you approve them individually.
To approve moderated comments, go to the Comments screen and click the ``Approve comment'' button beside each comment that you want to approve.
To accept comments from registered users, go into Weblog Config, then Preferences, then select the checkbox ``Accept Comments from Registered Visitors''. This should unfold a subordinate set of checkboxes and input fields.
You'll also need to insert a TypeKey token into the field that appears when you've selected this checkbox. To sign up for a free TypeKey account, visit the TypeKey website at www.typekey.com. The token is a string of 20 characters that identifies your weblog to the TypeKey authentication service. You'll also need to let TypeKey know the URL of your weblog. To do so, log in to your TypeKey account and follow the instructions on that screen.
To find more information about the other comment registration options, see ``Comment Registration Configuration''