This is the blog of Adam Kalsey. Unusual depth and complexity. Rich, full body with a hint of nutty earthiness.
Freshness Warning
This blog post is over 21 years old. It's possible that the information you read below isn't current and the links no longer work.
2 Jul 2002
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.
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.
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.
<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.
1.0 - July 2, 2002
Initial release.
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.
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.
MTSmartBody is used just like MTEntryBody. It doesn't need to be closed, and can be used anywhere MTEntryBody is used.
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?
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.
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.
Hi, I'm having the same problem with version 2.21 Did you manage to solve if?
I had to write the tag as MTEntrySmartBody to get it to work???
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.
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?
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
Excerpt: Kalsey's SmartBody plugin and a few tweaks
Excerpt: Kalsey's SmartBody plugin and a few tweaks
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.
Vix
July 6, 2002 6:50 PM
This is exactly what i need for one of my sites! Thank you!!