Problem with Related Posts in BlogEngine.NET 1.4

With the new release of BlogEngine.NET a new feature was added that shows the description or part of the post when listing related posts. If the description is empty a small part of the post content is listed instead and here in lies the problem. The post content is simply clipped as a certain length without regard to any tags in the post. Let's say a related posts goes like this:


With the new release of
BlogEngine.NET a new feature was added.


Now, when the post is clipped it may end up cutting in the middle of the href:


With the new release of arrow-down

string content = Utils.StripHtml(post.Content);

Or you can download the appended file and replace the one in the App_Code/Controls/ folder.

Download RelatedPosts.cs (3,8KB)

Comments (1) -

  • Andy McKay

    2014-02-09 01:25:45 | Reply

    I wish I had discovered your post sooner, spent hours tracking down the cause of apparently random layout screw ups after adding the related posts control in BlogEngine ver 2. The source of my problem was tags directly in the post description, the existing logic in the current version does not check for this, so you need to make sure and strip out HTML from that as well as the content clippings.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.