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

DotnetKicks

Tags: ,

ASP.NET | BlogEngine.NET

Embed Picasa slideshows into BlogEngine.net

by Administrator 11. September 2008 14:00

I was having a problem embedding a slide show from Picasa into my BlogEngine.net editor. Basically, the editor kept stripping the embed html.  The trick is to edit \admin\tinyMCE.ascx file.  You need to modify the extended_valid_elements entry. Apparently this is used to define valid html tags for the tinyMCE editor. Here are my additions in red:

extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style],

script[charset|defer|language|src|type],code,iframe[src|width|height|frameborder|name|style],

embed[type|src|width|height|flashvars|pluginspage]",

Have fun!

DotnetKicks

Tags: ,

ASP.NET | Blogging Tips | Development Tools | Tech-Tips

Insert Code for Windows Live Writer

by Administrator 4. September 2008 14:55

If you are a developer using C#, Visual Basic, Javascript and other and need to insert code into your blog posts, you'll need this extension which according to the web site enables you to:

"Insert Code for Windows Live Writer will format a snippet of text in a number of programming languages such as C#, HTML, MSH, JavaScript, Visual Basic and TSQL."

Go HERE to download.

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

© Copyright 2014 X Talks Tech