This is an excerpt from a forum post that Kev made, it gives expandable comment capability to MT!

Author: CanuckKev
Subject: Collapsable Comments/Extended Entry
Posted: Sat Mar 06, 2004 11:59 pm (GMT 0)
Topic Replies: 0

I tried to make this a blog post, but it really screwed up the formating, so I decided to post it here.

The original code was take from this site and was modified by me.

First off, let me say that the following changes are made to your main template. Do not make any changes without making a backup first.

Now, on to the code. The first bit of code is added between the <head> and the </head> tags in your template.

<script language=”javascript” type=”text/javascript”>
function showMore(varA1, varB1){
var123 = (‘varXYZ’ + (varA1));
varABC = (‘varP’ + (varA1));
if( document.getElementById ) {
if( document.getElementById(var123).style.display ) {
if( varB1 != 0 ) {
document.getElementById(var123).style.display = “block”;
document.getElementById(varABC).style.display = “none”;
} else { document.getElementById(var123).style.display = “none”;
document.getElementById(varABC).style.display = “block”; }
} else { location.href = varB1;
return true; }
} else { location.href = varB1;
return true; }

function showMoreComments(varA12, varB12){
var1232 = (‘varXYZ2’ + (varA12));
varABC2 = (‘varP2’ + (varA12));
if( document.getElementById ) {
if( document.getElementById(var1232).style.display ) {
if( varB12 != 0 ) {
document.getElementById(var1232).style.display = “block”;
document.getElementById(varABC2).style.display = “none”;
} else { document.getElementById(var1232).style.display = “none”;
document.getElementById(varABC2).style.display = “block”; }
} else { location.href = varB12;
return true; }
} else { location.href = varB12;
return true; }

This provides us with the ability to have the collapsable comments and extended section.
Now, for the Extended Entry section, you need to replace the current code between the <MTEntryIfExtended> and </MTEntryIfExtended> section with the following:

<span id=”varP<$MTEntryID$>”>
<a href=”<$MTEntryLink$>#more<$MTEntryID pad=”1″$>” onclick=”showMore(<$MTEntryID$>,'<$MTEntryLink$>#more<$MTEntryID pad=”1″$>’);return false;”><p>Continue Reading “<em><$MTEntryTitle$></em>” »</p></a>
<br /></span>
<div id=”varXYZ<$MTEntryID$>” style=”display: none”><p><$MTEntryMore$></p><a href=”#more<$MTEntryID pad=”1″$>” onclick=”showMore(<$MTEntryID$>,0);return
true;”><p>« All Done</p></a>

You will notice the following two parts:

<p>Continue Reading “<em><$MTEntryTitle$></em>” »</p>


<p>« All Done</p>

Both of these parts are displayed as the links to show and hide the extended entry. You may modify this to suit your needs.
Next is the code for the comments section. This will be placed between the <MTEntryIfAllowComments> and </MTEntryIfAllowComments> tags.

<span id=”varP2<$MTEntryID$>” class=”extended”><a href=”<$MTEntryLink$>#comments<$MTEntryID pad=”1″$>” onclick=”showMoreComments(<$MTEntryID$>,'<$MTEntryLink$>#comments<$MTEntryID pad=”1″$>’);return false;”><p>There are (<$MTEntryCommentCount$>) Comments. <br>Show Comments here »</p></a><br />
</span><div id=”varXYZ2<$MTEntryID$>” style=”display: none”>
<p>Posted by <$MTCommentAuthorLink$> at <$MTCommentDate$></p><br /><br />
<a href=”#comments<$MTEntryID pad=”1″$>” onclick=”showMoreComments(<$MTEntryID$>,0);return
true;”><p>« Hide Comments</p></a></div>

You will notice the lines:

<p>There are (<$MTEntryCommentCount$>) Comments. <br>Show Comments here »</p>


<p>« Hide Comments</p>

They are the customized display for the show/hide comments. Customize to what you need.
I hope this helps, and you can see this in action on my site .
If you have any problems or questions with the code, post them. I’ll see what I can do to help.
Kevin aka:CanuckKev

It Doesn’t Matter… Just Ride!

7 responses

Do you want to comment?

Comments RSS ?

or an incidental, can sometimes be hilary duff noticed and played up in the mix to paris hilton great effect. I’ll attest to all of brooke burke the above from experience. I can think carmen electra of another particularly helpful exercise, anna nicole smith though I wasn’t aware of it at the clay aiken time: I was, some years back, even svetlana khorkina MORE hypercritical of my own writing dragonball

October 29, 2004 6:59 am

candid feet, nice pictures of street shoots, street feet, candids, in the street, feet in city,candid shots, candid photos,candid pics, streetshots fotos videos

June 9, 2005 12:29 pm toon girls cartoonadulthumor

June 15, 2005 9:37 pm

internet advertising internet advertising free advertising free advertising advertising specialties advertising specialties home depot home depot work at home work at home home based business home based business internet marketing internet marketing network marketing network marketing search engine marketing search engine marketing better business bureau better business bureau home based business home based business business cards business cards shopping cart shopping cart ecommerce shopping cart ecommerce shopping cart shopping cart software shopping cart software house plans house plans white house white house full house full house

June 29, 2005 2:13 am much bathroomdiscussedwithdraws

July 19, 2005 8:49 pm

Please take a look at some helpful info on no limit texas holdem no limit texas holdem … Thanks!!!

July 20, 2005 3:07 am

Sorry, the comment form is closed at this time.