MovableType Tip: Comment Status
Thanks to the latest build of MovableType, users now have three options for the handling of comments in their entries - none, open, and closed. That said, even if you decide to close access to an entry's comment thread, users won't know whether a thread is available for commenting until after they enter their form data, click Post, and are then greeted with a "This Thread is Closed" error message.
A better solution is to tell users, up front, whether comments are open, closed, or not offered at all. Thanks to Ben at MovableType, he passed along to me a handy template to accomplish just this - modify to fit your site at will.
<MTEntryIfAllowComments>
<MTEntryIfCommentsOpen>
<$MTEntryCommentCount$> Comments
<MTElse>Comments not available</MTElse>
</MTEntryIfCommentsOpen>
<MTElse>Comments are closed
</MTElse>
</MTEntryIfAllowComments>
Comments
Could you please elaborate a little on this? ;-) Where to put it (main index? Comment listing template?), how and why? :-)
Posted by: David Blangstrup at February 19, 2003 11:23 AM
This copy would go wherever you place a link to your comments. On my site, this would be placed to the right of "Link to this entry" - the text would change according to how you are offering comments. The textual content inside the MT tags would change to whatever you want it to be. In my case, I wrap each comments option with pop-up link tags, so you can still read the old comments even after it has been closed.
Posted by: Todd Dominey at February 19, 2003 12:13 PM
So I just replace MTifallowcomments with the whole hog? I'm a little nervous here, poking around in the motor...
Posted by: David Blangstrup at February 19, 2003 1:04 PM
That's right. But you would obviously change the textual content inside the tags to fit what you already have going on.
Posted by: Todd Dominey at February 19, 2003 1:08 PM
...but you say that you wrap each comment with popup link tags - I would like to do that, too, but... I can't read your code from the html. You wouldn't care to email your code to me, so I can see how you've done it? Thanks! ;-)
Posted by: David Blangstrup at February 19, 2003 1:16 PM
Well, I had to work it out on my own... better this way, huh? ;-)
Funny thing is, that I had to switch the closed and the not available!?!
Now it's working. :-) If it's correct I don't know.
Thanks for the code and the directions!
- David
P.S.: I had to write a link instead of a href for obvious reasons, and ] instead of > ;-)
[MTEntryIfCommentsOpen]
| link start[$MTCGIPath$][$MTCommentScript$]?entry_id=[$MTEntryID$]" onclick="OpenComments(this.href); return false">Comments ()(link end)
(link start)?entry_id=" onclick="OpenComments(this.href); return false">Comments are closed (link end)
[/MTEls]
[/MTEntryIfCommentsOpen]
[MTElse]Comments not available[/MTElse]
[/MTEntryIfAllowComments]
Posted by: David Blangstrup at February 19, 2003 6:25 PM
It wasn't really that difficult to have open / closed comments with MT before, with a little PHP to assist. The trick is to have your comments display outside of the MTEntryIfAllowComments container, keep the form info inside the container, and have the PHP display comment headers if there were more than zero.
But then again, this opens it up to a whole bunch of non-technical users, and kudos to that, I guess.
Posted by: Marq at February 20, 2003 7:01 PM
The only thing missing for MT comments now is expiration of new comments after some amount of time... such as in Textpattern.
Would be nice to have something automatic like that so that the recent comments on a site aren't flooded with crap from googlers.
Posted by: Andy at February 20, 2003 10:27 PM
Perhaps this goes without saying, but rather than dumping more text and/or deterring readers from reading existing comments, you could also "MTElse" out the form at the end of your actual comment list template.
By encasing the Form within the IfCommentsOpen tags, and then "Comments for this entry are closed" within an MtElse tag, readers can still read all the existing comments, they just aren't presented with the misleading form.
Just an idea.
Posted by: Jory at February 22, 2003 11:42 PM
Ah I've been looking for this code. They really should publish this in the manual in the next release.
Posted by: webspiffy at April 4, 2003 3:30 PM
