Two PostList Extensions to the BlogEngine.net Platform

by Xavier Pacheco 5. June 2009 02:06

My blogging platform of choice is the open-source BlogEngine.net. Why? Because if there's a feature not inherently supported, I can simply fire up Visual Studio and write it myself. Ok, so BlogEngine.net is not for the faint of heart when it comes to blog deployment, but for power bloggers who are unsatisfied with the limitations of other platforms, BlogEngine.net is that way to go.

This post is about two features that I needed to develop myself. I am making them available here for other BlogEngine.net users.

1. An Author-filtered post list for non-blog pages

BlogEngine.net has the capability to add static web pages. This enables you to use BlogEngine.net as more than just a blogging platform. I have used BlogEngine.net to develop regular websites, for instance see www.CubScoutPack55.com and www.xapware.com.

I needed to add a bloglist to a static page, however the list should display only posts for a given author. Note that this is not the same as the standard filtered postlist supplied with BlogEngine.net. Already, there is a user control (\user controls\PostList.aspx) that you can embed within a static page by entering the following text into the page's markup:

uc1

That's all fine except that I need display only posts by a specific author. Therefore, I created the AuthorPostList.ascx user control. The entry in the static page markup now becomes:

uc2

You will see this implemented in the cub scout site: www.CubScoutPack55.com where each den page has its own author, the Den Leader for that page. When a certain Den Leader, say for instance the Tiger Den Leader, enters a blog post, his post will show up only in his page. This is handy because it allows me to distribute blog posts according to the poster.

You can download the control at the bottom of this post. To use it, simply pop it in your "/User controls" directory and add the following text to any static page.

uc3

2. A Category-filtered post list for non-blog pages

I recently created a blog for my family at: www.PachecosInColorado.com. We have a major event happening and wanted to create a static section within our site to keep our family and friends up to date (we are adopting from Ethiopia). In the same way that I embedded author specific posts on a static page, I want to embed category specific posts on a static page. Therefore, only posts related to the "Adoption" category would appear on the page for adoption. Posts in other categories like recipes, home-schooling, etc, would be filtered out.

My solution was to create the CategoryPostList.ascx user control. It is also located in the user controls directory. To use it, you simply put the following into the markup of the page where you want the posts to appear:

uc4

That's it! You can download this control here. Try it out and feedback, corrections, comments, questions are welcome.

The Controls

AuthorPostList

CategoryPostList

Tags: ,

ASP.NET | BlogEngine.NET

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



This site is Hosted by WebHost4Life

Join WebHost4Life.com

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

© Copyright 2010 X Talks Tech