VistaDB.Net Logo

BlogEngine rollout and my first extension

by Jason Short 18 May 2009

We have rolled out BlogEngine.net as our blogging engine now (you should be reading this through BlogEngine unless you are reading the RSS).

The migration actually went really smooth.  There are a few things I miss from the old engine, but the presentation side of things is great.

In the process I decided I wanted to customize the output of the blog for the single page displays to include AddThis.com, DotNetShoutOut, DotNetKicks, and DZone social network voting systems.  But I only wanted it on the single page view, on the main view I think they tend to look too cluttered.  Part of my way of doing it led me to write my first extension.

Missing?

First, there is nothing really missing.  I guess miss a few features from Graffiti.  The admin view page in Graffiti shows you the number of views your blog has had for the day, and is a new graphical boost to your blogging ego.  I have found it a great way to track over time if the blog is gaining readers or not.  

Of course it turns out this is also the most terrible thing in Graffiti for performance.  Most people I talk to who say that Graffiti performs poorly with VistaDB are actually talking about this form.  The data is stored in a table named Post_Statistics and it is very poorly normalized.  My current table had 1.9 million rows in it.  Each and every time a user read from a post an entry is made here.  

This is a terrible table because there are NO indexes on the posts column, or the DateViewed column.  Adding them speeds up the query to sum the dates a lot, but it is still going to be slow after a while.  The data should have been normalized to only include hits from a specific date, and then to summarize the dates statistics into another long term table.  Periodically cleaning this table has been the best way to improve the performance of Graffiti.

Another thing I miss is the ability to view multiple versions of a post.  Graffiti stored all the changes to each blog entry, and let you view all the changes over time.  Now to be honest, this was rarely used.  But it was always comforting to know that if the editor went nuts when I was editing a post (or IE posted garbage) I could recover to an older version of the post by a simple rollback type procedure similar to what I do with my source code.

Social Network Extension

I liked the customizations I had made in Graffiti to include the AddThis.com Bookmark button and other social network sharing buttons like DotNetShoutOut.  Initially I made the same changes to BlogEngine for my themes primary view.  But I didn't like the look on the main form when you have 5 posts showing to see 5 AddThis buttons as it didn't make sense to me.  I only wanted it to show when a single post was being viewed.

Well, it turns out I could have done this in the theme post view code behind (there is a SinglePost flag to tell you when the engine is serving a single post), but I made an extension.  It only took about 30 minutes and I think it is sort of neat to have it.

 

Custom Extension Screenshot

 

This is a screen shot of the extension panel I made, pretty cool that you can include help as a part of the extension.

Basically you can turn this on or off for your theme and it will insert the button at the bottom of your post (optionally only when you are in single post view mode).  You can specify the account for AddThis and some other options.

How to use the SubmitStoryExtension

You can use this same extension in your own BlogEngine.net blog by putting the code in your App_Code\Extensions folder and loading the admin panel.  It will show up as an option and you can select Edit to change your options.

 

SubmitStoryExtension.zip (2.69 kb)

I was really impresed how easy it was to build, and it was fun to play around with the object model and get my feet wet in the code.

 

Comments

18 May 2009 #

trackback

BlogEngine rollout and my first extension

Thank you for submitting this cool story - Trackback from DotNetShoutout

DotNetShoutout

18 May 2009 #

Al Nyveldt

The new blog looks great and I'm really glad you are making your first extension available for others. Extensions are a really overlooked feature of BlogEngine. They are so easy to write and yet can do so much cool stuff.

Al Nyveldt United States

18 May 2009 #

js_vistadb

@Al
Extensions are very easy to build.  I was surprised.  I have written them for other engines, and this is honestly the easiest one I have ever built.  The object model makes good intellisense programming - you can just pick up the objects and . them to see what they can do.  That is usually how I experiment with things.

@Kane - IE6?  Can you even still run that on a supported OS?  I don't even think that IE 8 compatibility modes go back that far.  And looking at our site stats the IE6 numbers are not even on the list, so probably not a big deal.  Actually 60% of our users use Chrome, sort of surprised me.

js_vistadb United States

20 May 2009 #

js_vistadb

I just noticed one small thing with the Social Bookmark poster.  If you are on a domain where the www is not enforced (this is an option in the blog settings panel) you can end up with the same story posted twice (one for the www version and one without).  For now I have forced it on for my site.

js_vistadb United States

Comments are closed

Powered by BlogEngine.NET and VistaDB

Log in