37 Comments

You may or may not have noticed the Poll Widget on the left hand side of this blog... This was originally developed by Fatih Sever for BlogEngine.NET 1.x. This widget was so successful that Mads himself didn’t even make one because of Fatih’s hard work.

Since the major release of BlogEngine.NET 2.0, many extensions and widgets (including the Poll Widget) were affected by breaking changes. Because I really needed a Poll Widget ASAP I decided to take the source and update it to work with BlogEngine.NET 2.0 along with a couple of bug fixes to make it more resilient to arbitrary configuration and the new script object.

Fatih has graciously allowed me to host the download on my site as I am continuously making small changes and bugging him all the time for updates is becoming an issue. So here we go:

If you are looking for the Poll Widget that works in BlogEngine 1.x (because this one is not backward compatible) then you can download it from Fatih Sever's original post.

Important Information

Custom Themes
Only the standard theme is updated with the required CSS stylesheet for the Poll Widget. If you are using a custom them you need to follow the steps below:

  1. To add the CSS to the theme that you use open the file .\themes\YourThemeName\site.master and add the following HTML in the HEAD tag along with any other external stylesheet declarations:
    <link rel="stylesheet" href="poll.css" type="text/css" />
  2. Copy the file progress.gif and poll.css from .\themes\Standard\ to your custom theme directory.

Troubleshoot Problems

If the widget won't be added using your current theme you can do two things:

  1. Switch to the Standard theme, add it, then switch back to your theme.
  2.   OR
  3. Edit .\App_Data\datastore\widgets\be_WIDGET_ZONE.xml and add the widget directly with the following XML:
    <widget id="3E9B34D6-2343-11E0-829C-FB02DFD72085"
            title="Poll" showTitle="True">Poll</widget>

    You can change the GUID to any valid GUID value that you want.

    If you get any error with the widget you can usually pick up the script error using developer tools for your browser. IE usually has the script error dialog turned on by default, look for the warning symbol in the bottom left corner.

    If you have the logging extension turned on then non-script widget errors will be logged to .\App_Data\logger.txt by default.

Thanks again to Fatih for the great widget!