CS Nuglet: Taming the 2008.5 Blog Post Excerpt

If you go with excerpts on a Community Server 2008.5 blog, they may look funky and you may wonder why.  Wonder no more, because CS2008.5 excerpts are now in HTML format. I would think this has to be an oversight in CS2008.5, but haven’t seen anything official about it either way. Up to and including CS2008, excerpts were stored in plain text. Don’t believe me? Here are excerpt edit controls for CS2007, CS2008 and CS2008.5.

 

 

 

Excerpts continue to be stored as a PropertyValue in cs_posts, and in CS2008.5 include the HTML you see on the second pic below.
 

 

The WeblogPostData Chameleon Control has a smart GetExcerpt() method for the “excerpt” property to display the post excerpt if it’s present.  The problem is that the method hasn’t been updated to handle an HTML-based excerpt, thus the display weirdness.

If you don’t have your own custom WeblogPostData control, you’re SOL.  (Who doesn’t leave the house without their own WeblogPostData control?)  Otherwise, updating GetExcerpt() to remove the HTML formatting and turn off auto-elipsing begins the process of taming the CS2008.5 Excerpt.

Referring to our custom control in the PostList and TagList pages takes us home.

Article written by

A long time developer, I was an early adopter of Linux in the mid-90's for a few years until I entered corporate environments and worked with Microsoft technologies like ASP, then .NET. In 2008 I released Sueetie, an Online Community Platform built in .NET. In late 2012 I returned to my Linux roots and locked in on Java development. Much of my work is available on GitHub.