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:

[code:html]

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


[/code]

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

[code:html]

With the new release of arrow-down

[code:c#]
string content = Utils.StripHtml(post.Content);
[/code]

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.

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