Back in March 2008, Al Nyveldt wrote a Most Popular Post Extension and Widget for Blogengine.Net. Dutifully, I downloaded it and tried to install the widget using the BE 1.4.5 widget framework, but it did not work. A quick check of Al's html source code revealed that he created the widget to operate outside the new widget zone framework. Knowing the answer and then reviewing his website, it became clear why he did this ... he has two columns on the right side with widgets in both columns. Currently BE 1.4.5 only supports one widget zone (or column), although the blog administrator can put multiple widgets inside the one widget zone.
What I wanted was the most popular post widget to work within widget zone framework. I modified the widget to work within the new widget zone framework. Necessity creates modification. For the sake of time and space, I will not go into the motivation or stickiness factor of why you should use this widget (this information can be found in Al's post linked above). The cool part is that I only needed to change the source file that reads the count and displays the results.
To set up this widget, follow the same procedure as before:
- Download the TopPost extension file, TopPostsExtension (this has not been modified), and place it in the App_Code/Extensions directory.
- Download the TopPost widgets directory and files, TopPostWidget (this is new), and place the directory in the widgets directory. You will now have a widgets/TopPosts directory with four files in it (edit.ascx, edit.ascx.cs, widget.ascx, widget.ascx.cs)
- Sign into your blog and add the TopPosts widget from the widget zone pull down and your good to go.
I am not sure Al specifically designed this widget to separate the writer/counter function from the reading function, but by doing so, the architecture upgrade does not reset you postview file counts. This is very nice.
Downloads:
TopPostsExtension.zip (902.00 bytes)
TopPostWidget.zip (3.18 kb)
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5