Converting MT to use the new comment stuff

| tutorials | | Comments (2)

(I need someone to test this, so please let me know what happens and I can make updates as needed. -Thanks, Lisa)

So you've upgraded but haven't changed your templates. There's a few things you'll want to do to be able to use the spiffy new comment-y stuff.

1) Get rid of your Javascript popup comment window. Change the links on your Main Index to:
<MTIfCommentsActive>| <a href="<$MTEntryPermalink$>#comments">Comments
(<$MTEntryCommentCount$>)</a></MTIfCommentsActive>
<MTIfPingsActive>| <a href="<$MTEntryPermalink$>#trackback">TrackBacks
(<$MTEntryTrackbackCount$>)</a></MTIfPingsActive>

2) Make sure you have the new Javascript file. You can find it here if it's missing. Create a new Index Template. Be sure to make the Output Filename mt-site.js. Paste the text in and save and rebuild it. (You can set it to not rebuild automatically with index templates because it won't change again.)

3) Fix up your Individual Entry Archive template.
(This is more complicated so it's in the extended entry.)

a) Add the following somewhere between the <head> and </head> tags:
<script type="text/javascript" src="<$MTBlogURL$>mt-site.js"></script>

b) Then add the following text in your <body> tag:
onload="individualArchivesOnLoad(commenter_name)"

(so if it was <body class="some_cool_class">, it would now be <body class="some_cool_class" onload="individualArchivesOnLoad(commenter_name)">)

c) Update the comment section of the page. You can remove the old stuff (I'd recommend saving it in a text file in case you want to go back and steal the formatting once we're done).

Note: That brings in a ton of styles that you won't have. You can either reformat your code or go here and get the missing styles and whatnot.

Instead of what you had, paste in the following (taken from here):

<MTIfCommentsActive>
<div id="comments" class="comments">
<div class="comments-content">
<MTComments>
<MTCommentsHeader><h3 class="comments-header">Comments</h3></MTCommentsHeader>
<a id="c<$MTCommentID pad="1"$>"></a>
<div class="comment" id="comment-<$MTCommentID$>">
<div class="comment-content">
<$MTCommentBody$>
</div>
<p class="comment-footer">
Posted by:
<$MTCommentAuthorLink default_name="Anonymous"$> <$MTCommentAuthorIdentity$> |
<a href="#comment-<$MTCommentID$>"><$MTCommentDate$></a>
</p>
</div>
</MTComments>
</div>

<MTEntryIfCommentsOpen>
<form method="post" action="<$MTCGIPath$><$MTCommentScript$>" name="comments_form" onsubmit="if (this.bakecookie.checked) rememberMe(this)">
<input type="hidden" name="static" value="1" />
<input type="hidden" name="entry_id" value="<$MTEntryID$>" />

<div class="comments-open" id="comments-open">
<h2 class="comments-open-header">Post a comment</h2>

<div class="comments-open-content">
<script type="text/javascript">
<!--
writeTypeKeyGreeting(commenter_name, <$MTEntryID$>);
//-->
</script>

<MTIfCommentsModerated>
<p class="comments-open-moderated">
(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)
</p>
</MTIfCommentsModerated>

<div id="comments-open-data">
<div id="name-email">
<p>
<label for="comment-author">Name:</label>
<input id="comment-author" name="author" size="30" />
</p>
<p>
<label for="comment-email">Email Address:</label>
<input id="comment-email" name="email" size="30" />
</p>
</div>

<p>
<label for="comment-url">URL:</label>
<input id="comment-url" name="url" size="30" />
</p>
<p>
<label for="comment-bake-cookie"><input type="checkbox"
id="comment-bake-cookie" name="bakecookie" onclick="if (!this.checked) forgetMe(document.comments_form)" value="1" />
Remember personal info?</label>
</p>
</div>

<p id="comments-open-text">
<label for="comment-text">Comments: <MTIfAllowCommentHTML>(you may use HTML tags for style)</MTIfAllowCommentHTML></label>
<textarea id="comment-text" name="text" rows="10" cols="30"></textarea>
</p>
<div id="comments-open-footer" class="comments-open-footer">
<input type="submit" accesskey="v" name="preview" id="comment-preview" value="Preview" />
<input type="submit" accesskey="s" name="post" id="comment-post" value="Post" />
</div>
</div>
</div>
</form>
</MTEntryIfCommentsOpen>
</div>
</MTIfCommentsActive>

2 Comments

eschamp said:

What kind of test??

Lisa said:

Basically someone with a Movable Type weblog (who upgraded but kept their old templates) would follow the steps and make sure that things worked when they were done. Because I'd already had this done on my weblog when I wrote it up so that makes it hard to test after the fact. But I'm pretty sure that it's correct.

Leave a comment

About this Entry

This page contains a single entry by Lisa published on November 7, 2005 6:40 PM.

Conversion process was the previous entry in this blog.

New cat litter = confused Katya is the next entry in this blog.

Find recent content on the main index.

Me!

A little rudeness and disrespect can elevate a meaningless interaction to a battle of wills and add drama to an otherwise dull day.—Calvin and Hobbes

About me... :: memes :: My Amazon wishlist :: My LJ :: My Twitter :: My Flickr :: Photos of me

Blog reading list

Contacts
· AIM, Yahoo!, MSN, Google Talk, LJ Talk... just ask
· Email me

Good Causes

       
Love is love.
Support gay marriage.

platinum.gif
East siiiiiiiiiiiiiiiiiiiide, baby!
Click to help
sponsor mammograms
Listen to good music! Radio Paradise

Silly Stuff

blogchalk:
Lisa/Female/41-45. Lives in United States/Mass/Boston and speaks
English. Spends 80% of daytime online. Uses a Faster (1M+) connection.
The
WeatherPixie
The weather in Boston

Flickr

www.flickr.com
jasra's photos More of jasra's photos
Powered by Movable Type 4.1

Copyright

Copyright © 2001-7 Lisa K Holsberg. Unauthorized use is prohibited.