Need someone to lead product or development at your software company? I lead product and engineering teams and I'm looking for my next opportunity. Check out my resume and get in touch.

SmartBody Plugin

Freshness Warning
This article is over 18 years old. It's possible that the information you read below isn't current.

MTSmartBody is a Movable Type plugin that inserts a post’s excerpt if it has one and the post’s body if it doesn’t.

A bonus tag included with MTSmartBody is the container tag MTEntryIfExcerpt. The contents of this tag will be displayed if an entry has an excerpt.

Why would you want such a thing? It’s a useful replacement to auto-generated excerpts. In your RSS file or your main index template, it would be nice to display the excerpt if you wrote one, but you’d rather not see a truncated copy of your post used if you don’t have an excerpt.

Tim Appnel has taken over the maintenance and support of this plugin as of Oct 2004.

Download

You can get SmartBody by downloading SmartBody.zip.

Installation. Once you’ve downloaded and unzipped SmartBody.zip, connect to your FTP server and open the directory where you have Movable Type installed.

Create a directory there called plugins if there isn’t one already.

Copy SmartBody.pl to the plugins directory and set the permissions to 755.

Using MTSmartBody

Once you’ve installed MTSmartBody, using it is as simple as placing a new Movable Type tag in your template.

The <MTEntrySmartBody> and <MTEntryIfExcerpt></MTEntryIfExcerpt> tags go between the <MTEntries></MTEntries> tags. MTSmartBody will check to see if an entry has an excerpt and insert it if it does, or insert the body if it doesn’t.

MTEntryIfExcerpt will also check to see if an entry has an excerpt and insert the contents of the tag if it does.

Example:

<MTEntries> 
	<MTEntrySmartBody> 
	<MTEntryIfExcerpt>
	<br><a href="<$MTEntryLink$>">Read more...</a>
	</MTEntryIfExcerpt>
</MTEntries>

License. Like our other freeware, this plugin is released under the open-source MIT License. In plain English, that means you can do whatever you want with the software, including modifying it, selling it, or eating it, but we’re not responsible for anything that goes wrong.

Revision History

1.0 - July 2, 2002
Initial release.

Vix
July 6, 2002 6:50 PM

This is exactly what i need for one of my sites! Thank you!!

Frank
July 13, 2002 9:57 AM

Hmm, doesn't the MTSmartBody have to be closed? I'm going to try it out now... so, I guess I'll find out in a minute.

Frank
July 13, 2002 10:05 AM

Indeed... it doesn't have to be closed. MT working with container tags and all, that seems a bit confusing to me. Besides, I use it in the individual entry archives, so I don't even have the MTEntries tags in there, just the MTBody tags and all. It seems to work just fine without the MTEntries tag being there though.

Adam Kalsey
July 13, 2002 10:48 AM

MTSmartBody is used just like MTEntryBody. It doesn't need to be closed, and can be used anywhere MTEntryBody is used.

ABoyCalled3
August 17, 2002 12:15 PM

Very cool idea and I appreciate your sharing the code. That said, I can't get MTSmartBody to work. I'm running 2.21, tested plugins by using the load.pl script from the manual and it worked, but using the code snippet given in the example gives me only a link to the individual entry that says "Read more..." if I've created an excerpt. IOW, MTEntryIfExcerpt seems to work but MTSmartBody does not. Is there some precedent for this?

Adam Kalsey
August 17, 2002 10:26 PM

If you look at the HTML file created by your template, what is in the place where the SmartBody tag is at? I'm assuming that you have an entry body or excerpt on the post. Otherwise the IfExcerpt tag wouldn't have worked. I haven't had anyone mention that it didn't work for them, but I've looked over the plugin and made a few changes that may help. Try downloading it again and see if it works for you now.

ABoyCalled3
August 18, 2002 8:04 AM

Thanks for your quick response. In the HTML generated by my template there is nothing at all in the place where the Smartbody tag has been placed. I can't include the full code snippet because this space allows for text-only posts, but the snippet that calls MTSmartBody and MTEntryIfExcerpt is the same as in the example above (though I've switched "br" to "br /"). See: http://www.thetoplessreview.com/archives/auth_brett.html Again, thanks for sharing this code with the MT community.

Tiziano
September 15, 2002 9:17 AM

Hi, I'm having the same problem with version 2.21 Did you manage to solve if?

girlie
November 9, 2002 11:46 AM

I had to write the tag as MTEntrySmartBody to get it to work???

Adam Kalsey
November 9, 2002 6:12 PM

Umm. Yeah. Hmm. I'm not sure how I managed to miss that one. And for so long. The correct tag is MTEntrySmarBody. I've fixed the documentation. Actually, this falls into the category of a plugin that I wrote for my own usage and then decided to make it available to everyone else too. I've got a few more of those, but I don't really feel like writting the documentation and supporting them.

Nardo
November 19, 2002 4:40 AM

The plugin works... but where I had paragraphs in my entries before, none now! Seems like the MTEntrySmartBody tag doesn't transform a couple of line breaks into another paragraph? Anyone else find this?

Adam Kalsey
November 19, 2002 7:24 PM

That's correct. The plugin is pretty much no-frills. I wrote it for a specific purpose of mine and only threw it out here on the off chance that someone else might find it useful. If you need breaks, try using Brad Choate's format breaks plugin: http://www.movabletype.org/cgi-bin/ikonboard/ikonboard.cgi?s=3ddaffd30ccfffff;act=ST;f=20;t=6348;hl=format+breaks

Trackback from la rawr de los muertos
November 19, 2003 7:18 PM

I'm Gwen and I'm awesome!

Excerpt: Kalsey's SmartBody plugin and a few tweaks

Trackback from la rawr de los muertos
November 19, 2003 7:19 PM

I'm Gwen and I'm awesome!

Excerpt: Kalsey's SmartBody plugin and a few tweaks

brian
December 26, 2004 9:27 PM

hey, great idea. i'm running v3, and use the plugin but whenever i do the formatting is completely off - it switches for left to centered and the fonts change. am i missing something?

This discussion has been closed.

Recently Written

A framework for onboarding new employees (May 15)
There’s no single good way to onboard an employee that works for every role. Here's a framework for creating a process that you can adapt to each situation.
TV hosts as a guide for software managers (May 10)
Software managers can learn a lot from journalists or late night TV hosts and how they interview people.
The Improvement Flywheel (Apr 29)
An incredible flywheel for the improvement of a development team. Fix a few things, and everything starts getting better.
Managers and technical ability (Dec 26)
In technical fields, the closer you are to the actual work being done, the closer your skills need to resemble those of the people doing the work.
Dysfunctions of output-oriented software teams (Sep 17)
Whatever you call it, the symptom is that you're measuring your progress by how much you build and deliver instead of measuring success by the amount of customer value you create.
Evaluative and generative product development (Aug 30)
Customers never even talk to the companies that don't fit their needs at all. If the only product ideas you're considering are those that meet the needs of your current customers, then you're only going to find new customers that look exactly like your current customers.
Product Manager Career Ladder (Aug 19)
What are the steps along the product management career path?
Building the Customer-Informed Product (Aug 15)
Strong products aren't composed of a list of features dictated by customers. They are guided by strong visions, and the execution of that vision is the primary focus of product development.

Older...

What I'm Reading

Contact

Adam Kalsey

+1 916 600 2497

Resume

Public Key

© 1999-2020 Adam Kalsey.