One stop shop for BlogEngine 1.3 extensions

by Klaus Graefensteiner 25. January 2008 06:29

I just finished upgrading my blog to BlogEngine version 1.3. While in the process of porting it to the new release, I spent some time experimenting with the extensions and the new BlogEngine 1.3 Extension Manager. I tried to keep track of most of the extensions that get posted on CodePlex and I thought I write a blog post that lists all the extensions that I found and demonstrates them in this post, if applicable. This way BlogEngine fans that don't keep track of all the traffic on CodePlex would get be able to quickly check the availability of a specific add-on for BlogEngine.

 

The Tools

The whole article was written with the current release of Windows Life Writer and the Code Snippet plugin for Windows Live Writer. The videos that I use for this post where created with Microsoft Movie Maker 2.1.

 

Extension Manager screen shot

After I deployed all the extensions that I found, I took the following screen shot. On this screen shot you will notice that some extensions are using the old format of adding a tabs to the extensions settings pages like the  , where others integrate into the new

 ExtensionManagerList

Before you start

Known bugs

I was using the 1.3.0.0 version of BlogEngine, which has a bug in the Extension Manager (http://www.codeplex.com/blogengine/WorkItem/View.aspx?WorkItemId=4910). Please get a later release that has a bug fix for this issue. Otherwise you will get an "System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection Parameter name: index" error. I merged the changes from the 1.3.0.12 (9268) change set.

New bugs

I also found two bugs related to saving extension settings to the extensions.xml file. The first issue is that a Save operation seems to succeed although the extensions.xml file is write protected. I also found that the content of extensions.xml is sometimes incomplete. Some elements and closing tags are missing. It seems to be a good practice to have a backup of extensions.xml handy. I looked at the source code and I discovered that there is a "catch all and continue normally" during in the SaveXML() method of the manager.cs file. This explains that you can write to a write protected file and that a bad behaving extension can corrupt the extension.xml file without any warning. The thumbnailer extension has a bug for example that would cause such a corruption. The result is that some one would wonder why extension settings are always reset to the defaults.

Compatibility issues

Currently all the extensions that I tested didn't follow any consistent guidelines of where to put what kind of files. The supporting files are located all over the place. This makes it a little bit harder to maintain the extension plug-ins. I found one compatibility issue between the mp3player extension and the Silverlight media player extension. Both download a JavaScript file called Player.js. This leaves the second control without the correct JavaScript file, if both are used on the same page or post. I renamed the file used by the mp3player extension to mp3player.js and changed the extension source code accordingly to workaround this issue.

Kudos to the extension authors

Almost all extensions that I tested worked well. There was one extension that was not using the ExtensionsSettings framework appropriately and ended up exposing a design issue with the BlogEngine Extension Manager itself.

 

AkismetExtension

Description: Passes comments to Akismet for validation

Author's Blog: Justin Etheredge

Link to provider of 3rd party service: http://www.akismet.com

Related links: http://www.wordpress.com

Supported Versions: 1.2 and 1.3

Remarks: N/A

Demo:

AkismetExtensionParameters

 

BBCode

Description: Converts BBCode to XHTML in the comments

Author's Blog: BlogEngine.NET

Link to provider of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.2 and 1.3

Remarks: N/A

Demo:

BBCodeParameters

 

BreakPost

Description: Breaks a post where [ m o r e ] is found in the body and adds a link to full post

Author's Blog: BlogEngine.NET

Link to provider of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.2 and 1.3

Remarks: N/A

Demo:

 

CodeFormatterExtension

Description: Converts text between [ c o d e : c # ] and [ / c o d e ] tags to formatted syntax highlighted code (beta)

Author's Blog: www.manoli.net

Link to provider of 3rd party service: N/A

Related links: http://rtur.net/blog/post/2007/11/Insert-Code---your-options.aspx

Supported Versions: 1.3

Remarks: The tags should not be visible after the formatting, but in this case the result is appreciated.

Demo:

public void AddValue(string val)
{
    if (_values == null)
        _values = new StringCollection();
    _values.Add(val);
}

 

CopyCodeToClipboard

Description: Adds a link to syntax highlighted code to copy it to the clipboard.

Author's Blog: Troy Goode

Link to provider of 3rd party service: N/A

Related links: http://lvildosola.blogspot.com/2007/02/code-snippet-plugin-for-windows-live.html

Supported Versions: 1.3

Remarks: Requires Windows Live Writer Code Snippet PlugIn. Also make sure that you check the "Use Container" and un-check the "Embed Style" options before you insert the code snippet. Add the content of the attached *.CSS files to the styles.css of your theme. Modify the tags of the new styles so they match your theme. Make sure that the path to the "_clipboard.swf" file is set correctly and test your site with Firefox. The regex engine that scans the input source file gets exponentially slower by the size of the input source code string. Don't make them too big.

I also needed to make a small change to the source code itself. Windows Live Writer strips out the line breaks between the pre ending tag and a new pre beginning tag. I added a line of code that would inject the line break back in between the pre tags. This way the regex that is supposed to strip the line numbers off, will be applied successfully. See the source code change in the following source window at line 19.

Demo:

CopyCodeToWindowExtensionParameters 

InsertingCodeSnippetIntoWLW 

   1: private void InsertCopyCodeLink( ServingEventArgs e)
   2:     {
   3:         if( !string.IsNullOrEmpty(e.Body) )
   4:         {
   5:  
   6:             //### find code-div
   7:             string postID = Guid.NewGuid().ToString().Replace( "{", "" ).Replace( "}", "" ).Replace( "-", "" );
   8:             string toFind = "<div class=\"csharpcode-wrapper\">";
   9:             int index = e.Body.IndexOf(toFind);
  10:             while( index != -1 )
  11:             {
  12:  
  13:                 //### grab code out of code-div
  14:                 int end = e.Body.IndexOf( "</div>", index ); //### the first </div> should be the end of "csharpcode"
  15:                 end = e.Body.IndexOf( "</div>", end ); //### the next </div> should be the end of "csharpcode-wrapper"
  16:                 string code = e.Body.Substring(index, end - index);
  17:  
  18:                 //### add new line \r\n between </pre><pre in case Windows Live Writer stripped it out before publishing
  19:                 code = code.Replace("</pre><pre ", "</pre>\r\n<pre ");
  20:                 
  21:                 //### parse code out of code-div
  22:                 int codeStart = code.IndexOf("<pre ");
  23:                 int codeEnd = code.LastIndexOf("</pre>") + 6;
  24:                 code = code.Substring(codeStart, codeEnd - codeStart);
  25:                 code = Regex.Replace( code, @"<(.|\n)*?>", string.Empty ); //### strip html
  26:                 code = code.Replace( "&#160;", "" ); //### remove unnecessary &#160;s from the blank lines
  27:                 code = code.Replace( "&nbsp;", " " ); //### convert &nbsp;s to spaces
  28:                 code = Regex.Replace( code, @"^(\s*)(\d+): ", "" ); //### remove line numbers on first line
  29:                 code = Regex.Replace( code, @"(\n)(\s*)(\d+): ", "\n" );  //### remove line numbers on subsequent lines
  30:  
  31:                 //### create copy link
  32:                 string insertScript = @"
  33:                     <script type=""text/javascript"">
  34:                         var copyToClipboard@INDEX = CopyToClipboard_Strip('@CODE');
  35:                     </script>";
  36:                 string insertDiv = @"<div class=""CopyToClipboard"" style=""@STYLE""><div><a href=""javascript:void(0);"" onclick=""CopyToClipboard_ViewPlain(copyToClipboard@INDEX);"">@POPUPTEXT</a> | <a href=""javascript:void(0);"" onclick=""CopyToClipboard_Copy(copyToClipboard@INDEX);"">@COPYTEXT</a></div></div>";
  37:  
  38:                 //### set values for copy link and insert above/below code
  39:                 string insert = insertDiv + OutputCommonMethods() + insertScript;
  40:                 insert = insert.Replace( "@STYLE", settings.GetSingleValue("style") );
  41:                 insert = insert.Replace( "@POPUPTEXT", settings.GetSingleValue("popupText") );
  42:                 insert = insert.Replace( "@COPYTEXT", settings.GetSingleValue("copyText") );
  43:                 insert = insert.Replace( "@INDEX", postID + "_" + index.ToString() ); //### use index of code-div as a unique ID to allow multiple code-divs on this post
  44:                 insert = insert.Replace( "@CODE", code.Replace( "\\", "\\\\" ).Replace( "'", "\\'" ).Replace( "\r\n", "\\r\\n" ).Replace( "\\r\\n\\r\\n\\r\\n", "\\r\\n" ) );
  45:                 if( settings.GetSingleValue("aboveBelow").ToLower() == "above" )
  46:                     e.Body = e.Body.Insert( index, insert );
  47:                 else
  48:                     e.Body = e.Body.Insert( e.Body.IndexOf( "</div>", end + 1 ) + 6, insert );
  49:  
  50:                 //### prep index to find next code-div
  51:                 index = index + insert.Length + 1; //### ensure we don't find this same code-div again
  52:                 if( index > e.Body.Length ) break;
  53:                 index = e.Body.IndexOf( toFind, index ); //### find any other code divs
  54:  
  55:             }
  56:         }
  57:     }

 

DotNetKicks

Description: Adds a DotNetKicks button to a post where the token [ d o t n e t k i c k s]  is found.

Author's Blog: Sean Blakemore

Link to provider of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.2 and 1.3

Remarks: N/A

Demo: kick it on DotNetKicks.com

 

DownloadCounter

Description: Counts the number of downloads from your blog and displays the statistics on the extension admin page.

Author's Blog: RTUR.NET

Link to provider of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.3

Remarks: N/A

Demo:

DownloadCounter

 

flvplayer

Description: Plays Flash Video files in an embedded player using JW_FLV_Player

Author's Blog: Matthew J. Sherman

Link to provider of 3rd party service: N/A

Related links: JW_FLV_Player

Supported Versions: 1.2 and 1.3

Remarks: Embedding a player that plays test.flv is as easy as adding a [ f l v : t e s t . f l v ] tag to your post. Flash Video files (flv) can be encoded using Adobe Flash Professional CS3.

Demo: [flv:barsandtone.flv]

 

LightBox

Description: Adds support for using the LightBox js library for displaying images

Author's Blog: René Kuss

Link to provider of 3rd party service: N/A

Related links: LightBox Project

Supported Versions: 1.3

Remarks: Add image to post and add the following attribute rel="lightbox" to the image <a> link tag. For a series of images add the attribute rel="lightbox[lamps]" to each <a> link of the series.

Demo: Single image

P4200090

Demo: Image set

P4200085 P4200086 P4200087

 

mp3player

Description: Flash mp3 audio player

Author's Blog: RTUR.NET

Link to provider of 3rd party service: N/A

Related links: Audio Player Wordpress plugin

Supported Versions: 1.3

Remarks: Embedding a player that plays test.mp3 is as easy as adding a [ m p 3 : t e s t . m p 3 ] tag to your post. This player uses a JavaScript file called Player.js. The Silverlight extension uses a file with the same name. This file name clash could cause a player control to throw a JavaScript error and not be rendered.

Demo:

FlashMP3PlayerExtension

[mp3:test.mp3]

 

Odiogo

Description: Adds an Odiogo 'Listen' image button to the top of all posts.

Author's Blog: Mads Kristensen

Link to provider of 3rd party service: Odiogo

Related links: N/A

Supported Versions: 1.3

Remarks: The Odiogo service subscribes to your blog, reads blog posts and converts them into mp3 files. This service also adds your blog as podcast to iTunes. You need to sign up with Odiogo and receive an API Key that is used in the extension source code.

Demo: Checkout the "Listen now" Odiogo button at the beginning of each post

 

QuickerLinks

Description: Replaces Keywords with links.

Author's Blog: ckincincy

Link to provider of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.3

Remarks: Edit the mapping in the extension manager page. In this case t e m a will be replaced by tema . Make sure that you enter a value for the "CollectClickStats" attribute. Otherwise Windows Live Writer will complain that the "string is not a valid boolean value" during the publishing process.

Demo:

QuickerLinksExtension

 

ResolveLinks

Description: Auto resolves URLs in the comments and turn them into valid hyperlinks.

Author's Blog: BlogEngine.NET

Link to provider of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.2 and 1.3

Remarks: N/A

Demo: See also my own comment at the end of the post.

ResolveHyperlinkInCommentsExtension1

ResolveHyperlinkInCommentsExtension2

 

SendCommentMail

Description: Sends an e-mail to the blog owner whenever a comment is added.

Author's Blog: BlogEngine.NET

Link to provider of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.2 and 1.3

Remarks: N/A

Demo: N/A

 

SendPings

Description: Pings all the ping services specified on the PingServices admin page and send track- and pingbacks.

Author's Blog: BlogEngine.NET

Link to provider of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.2 and 1.3

Remarks: N/A

Demo: N/A

 

SilverlightPlayer

Description: Adds a Silverlight video player to the post.

Author's Blog: Sean Blakemore

Link to provider of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.3

Remarks: Embedding a Silverlight player that plays somevideo.wmv is as easy as adding the tag [ s i l v e r l i g h t : s o m e v i d e o . w m v ] to your post. Add the somevideo.wmv file into the Silverlight folder of your blog engine application. Make sure to add the mime type for xaml, extension - .xaml, mime type - application/xaml+xml to your server. The  Silverlight player doesn't seem to play any kind of WMV files. I created one by converting a MPG file from my digital camera to a WMV file using the Windows XP Movie Maker 2.1 software. This one worked. This player uses a JavaScript file called Player.js. The mp3player extension uses a file with the same name. This file name clash could cause a player control to throw a JavaScript error and not be rendered.

Demo:

SilverlightExtension

[silverlight:RollRobiRollVerySmall.wmv]

 

Smilies

Description: Converts ASCII Smilies into real Smilies in the comments.

Author's Blog: BlogEngine.NET

Link to provider of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.2 and 1.3

Remarks: N/A

Demo: See my own comment at the end of the post.

 

SnapLinks

Description: Replaces Snap keywords with SPAN tag to enable Snap Links on regular text.

Author's Blog: Chris Blankenship

Link to provider of 3rd party service: Snap

Related links: Clarence Klopfstein and Mads Kristensen. The following link points to the different kind of shap shots available: Shapshot Menu

Supported Versions: 1.2 and 1.3

Remarks: You need to sign up with Snap.com and copy some JavaScript into your page header before you can take advantage of this extension. Once this done,it is as simple as embracing a URL in by the following opening and closing tags: [ s U R L] url [ / s U  R L ]. Instead of using an URL different sets of tags take the embraced string as a key to query some well known web sites. Here are some more markup examples:

[ s Y o u T u b e ] YouTube video id [ / s Y o u T u b e ]

[ s W i k i p e d i a ] search keyword [ / s W i k i p e d i a]

[ s S t o c k ] stock symbol [ / s S t o c k ]

 

Demo:

SnapLinksExtension

A snap shot of an URL:

A snap shot of a YouTube video id:

A snap shot of a Wikipedia key word:

A snap shot of a stock symbol

 

Thumbnailer

Description: Creates thumbnail images for blog posts and pages while the content is being saved.

Author's Blog: René Kuss

Link to provider of 3rd party service: N/A

Related links: N/A

Supported Versions: 1.3

Remarks: To create a thumbnail picture of the referenced image just add the following tag to the img link as attribute: [thumb:height=50, width=50, link=lightbox]

Demo: This extension can't be demonstrated using Windows Live Writer as blog editor. But Windows Live Writer has this feature already built in. I encountered a bug with this extension and ended up disabling it. Unfortunately the BE Extension Manager catches all exceptions and ignores them, but if you set a break point into the catch block of the SaveXML() method in Manager.cs then you will see that the Thumbnailer extension causes an exception that will actually end up corrupting the extension.xml file and force BE to load the defaults for all other extensions that are installed.

P4200097

 

YouTube

Description: Embeds Youtube videos into posts and pages.

Author's Blog: Mads Kristensen

Link to provider of 3rd party service: YouTube

Related links: N/A

Supported Versions: 1.3

Remarks: The extension replaces the [ y o u t u b e : video id] tag with the appropriate HTML to embed a YouTube flash video.

Demo:

[youtube:ATlYBwBNApc]

Tags:

BlogEngine.NET

Comments

2/19/2008 5:26:38 AM #

Britton

Great Job Klaus!

Britton United States |

2/19/2008 5:42:45 AM #

Christian

This must have been a lot of work.

Thanks for putting this demo post together.

Christian

Christian United States |

10/20/2009 1:41:56 AM #

Saikat Hasan

this is hell of a job man. thanks a lot.

Saikat Hasan Bangladesh |

10/26/2009 1:21:05 AM #

Al Bsharah

Hey Klaus, nice job on compiling the list!

I would recommend you update the YouTube extension, as that particuar one has not been available for a very, very long time.  In fact, it's why I built my own version and published it...  Also built one for Vimeo.  Below are the links, and thanks again for the great list!

YouTube Extension:
al.bsharah.com/.../...Extension-YouTube-Video.aspx

Vimeo Extension:
al.bsharah.com/.../...T-Extension-Vimeo-Video.aspx

Cheers,
AL

Al Bsharah United States |

Comments are closed

About Klaus Graefensteiner

I like the programming of machines.

Add to Google Reader or Homepage

LinkedIn FacebookTwitter View Klaus Graefensteiner's profile on Technorati
Klaus Graefensteiner

Klaus Graefensteiner
works as Developer In Test and is founder of the PowerShell Unit Testing Framework PSUnit. More...

Open Source Projects

PSUnit is a Unit Testing framwork for PowerShell. It is designed for simplicity and hosted by Codeplex.
BlogShell is The tool for lazy developers who like to automate the composition of blog content during the writing of a blog post. It is hosted by CodePlex.

Administration

About

Powered by:
BlogEngine.Net
Version: 1.6.1.0

License:
Creative Commons License

Copyright:
© Copyright 2014, Klaus Graefensteiner.

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

Theme design:
This blog theme was designed and is copyrighted 2014 by Klaus Graefensteiner

Rendertime:
Page rendered at 9/2/2014 11:50:48 AM (PST Pacific Standard Time UTC DST -7)