tips and tricks for movable type

permalinks for comments
August 04, 2002

This bit of code will make the comment date a permalink to the comment on your Individual Archives Page. (I haven't yet thought hard enough on how to create a link that pulls up the pop-up comments window.)

In your Comments Listing Template and your Individual Archive Template, modify the default code like this (key changes in color):

<MTComments>
<div class="comments-body">
<a name="<MTCommentID pad="1">"></a>
<$MTCommentBody$>
<span class="comments-post">Posted by: <$MTCommentAuthorLink spam_protect="1"$> at <a href="<MTEntryLink archive_type="Individual">#<$MTCommentID pad="1"$>" "self.status='permanent link to this comment';return true" "self.status='';return true"><$MTCommentDate format="%I:%M %p"$></a></span>
</div>
</MTComments>

Related Links:

• Original post on the MT support forum

Comments

That's great! Thank you. :)

by maddy | 08.24.02 12:12 AM

Cool, thanks!

by shanni | 11.04.02 05:18 PM

i am extremely thick when it comes to these things... i only have Monthly archives, would i just substitue "monthly" for "individual" in that hunk of code?

thanks :)

by shauna | 01.28.03 09:08 PM

oh hang on, scratch my last comment... that won't work will it? coz it links to the individual archive page.

what i am after is something like Meg uses at notsosoft, except she doesn't use MT... i should post this on the MT forums shouldn't i.. hehe

by shauna | 01.28.03 09:18 PM

Try this code instead:

<MTComments>
<div class="comments-body">
<a name="<MTCommentID pad="1">"></a>
<$MTCommentBody$>
<span class="comments-post">Posted by: <$MTCommentAuthorLink spam_protect="1"$> at <a href="<$MTCGIPath$>mt-comments.cgi?entry_id=<$MTEntryID$>#<$MTCommentID pad="1"$>" "self.status='permanent link to this comment';return true" "self.status='';return true"><$MTCommentDate format="%I:%M %p"$></a></span>
</div>
</MTComments>

That gives you a permalink that will bring up the contents of your popup comments window (though not in an actual popup window - but that's the same thing Meg's permalinks do).

I guess linking to the popup didn't require as much thinking as I originally imagined when I posted this entry - but I'd still like to see it pull up a popup size window. Doable with Javascript, but I'd want it to be friendly to non-Javascript browsers like MT's OpenComments function is. Too close to my bedtime to get caught up in that right now! =)

by girlie | 01.28.03 09:38 PM

Oops - scratch part of that - you can't use this:

#<$MTCommentID pad="1"$>

So, while it will link to the popup page for that entry's comments, you can't link to the specific comment's anchored location on that page - because the URL calls the mt-comment.cgi script, not a static HTML document.

Unless someone else has some ideas! =)

by girlie | 01.28.03 09:46 PM

Gosh, another thought:

If <MTEntryID> doesn't work, try <MTCommentEntryID> instead.

Strangely, I can't locate anything in the MT docs that confirms that MTEntry tags work in an MTComments listing - yet the first code I posted (which I use here in this blog) contains an MTEntryLink tag, and it works just fine. Hmmmm. I thought you needed an MTCommentEntry container tag to do that.

by girlie | 01.28.03 10:04 PM

woo hoo! You and your code/scripts ROCK!

thanks :)

by pita | 06.16.03 05:41 PM

I'm sort of new at this and I am having a hard time getting this to work. I replaced the code and nothing happened. All I want is a little "permalink" at the bottom of each entry. What am I missing? Is there some other code somewhere that needs to be changed? I feel dumb asking this...but I am not sleeping much these days and I just can't figure it out.

by Angela | 07.28.03 11:41 PM

thank you again. I am using this one on my site. I'll have to update my toolbox blog and link these posts of your I'm finding.

by Madison | 11.05.03 08:58 PM

Execellent!
thx

by foolstone | 11.24.03 11:05 PM

Thanks for posting this. Random question, though: My sidebar has a section for links to recent comments, which takes advantage of these permalinks. On my main index page, this works brilliantly. On my individual archive pages, though, what I end up with are only links to recent comments on that entry. The code is exactly the same in both places. Any sense of what I need to do in order to make the recent comments listing reflect the entire site on the individual entry pages? Thanks!

by KF | 01.24.04 12:08 PM

Post a comment

(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.)

TrackBack: 12
(URL: http://www.thegirliematters.com/sf/mt-track.cgi/66)

» Linky dinky thinky
Excerpt: Todd wanted permalinks for the comments in his individual archives (which double as his comment template) like Michele has. When there's a will, there's a way, and I found a great tutorial at the girlie matters, so I thought I'd pass it along. I've add...
Weblog: Ain't too proud to blog
Tracked: 11.03.02 02:20 AM

» Permalink Your Comments
Excerpt: Thanks to the intrepid Robyn, I now have permalinks in my archives just like that sexy beast Michele. You can
Weblog: Neurotic Fishbowl
Tracked: 11.04.02 11:09 AM

» Participation Positives
Excerpt: I know it's not Monday any more (got sucked into an EverQuest vortex for the past eight hours), but I
Weblog: Neurotic Fishbowl
Tracked: 11.05.02 02:24 AM

» Permanent links in comments
Excerpt: Just because. Found at Robyn's (she found it at the girlie matters). (I sure find a lot of stuff at
Weblog: Unix Gal
Tracked: 01.11.03 01:38 PM

» recent comments
Excerpt: i had a few people ask about my code for the recent comments. it's a slightly modified version of robyn's
Weblog: TummyMonsters
Tracked: 03.06.03 06:20 PM

» Permalinks for Comments
Excerpt: I have added some code to this site that now allows everyone to link to specific comments in the comments section of the posts. So, for instance, if you needed to, you could link directly to this comment from "CubFanSteve"...
Weblog: The Clark & Addison Chronicle
Tracked: 07.12.03 10:59 PM

» Permalinks for Comments
Excerpt: I have added some code to this site that now allows everyone to link to specific comments in the comments section of the posts....
Weblog: Antioch Road
Tracked: 07.12.03 11:12 PM

» Hehe - I love new toys
Excerpt: I've been having SUCH a hard time concentrating today. I've been playing in between doing actual work-related tasks. I managed to get the permalinks for...
Weblog: Hey! ... it's Me!
Tracked: 09.06.03 11:50 AM

» Movable Type Enhancements
Excerpt: In trying to determine whether Movable Type (MT) was a feasible backend for OK/Cancel, I found a variety of sites and discovered just how big the MT community really was. If there's a function you can think of (and many...
Weblog: my:dentity
Tracked: 09.28.03 11:34 AM

» two cents
Excerpt: With a little help from my pal Robyn, and the tutorial over at [the girlie matters] I've changed my most recent comments side bar. Now when you click [go!] it will take you directly to the comment, rather than just...
Weblog: Simply Girly
Tracked: 11.11.03 05:09 PM

» Metablog Fun
Excerpt: In the last few days I have been making many, many changes to my blog. If you are one of my beloved commentors, you will notice I finally spruced it up with some css, so alas, there are still a...
Weblog: //gtmcknight
Tracked: 11.23.03 02:39 AM

» More Site Tweaks
Excerpt: First of all, I finally got with it and added permalinks for the comments. See this post on the girly...
Weblog: LilacRose
Tracked: 04.05.04 11:15 AM