This project is read-only.

Widgets display on serving type ...

Topics: Business Logic Layer, Controls
May 13, 2010 at 12:48 AM


I am looking for a little feedback on this idea.

I am not sure if this has already been covered by some other feature but I will run through what I have implemented and if there is something already available it was at least an opportunity for me to get familiar with the core project a little more.


Basically what I have been looking for is the ability to display the page list in a more organized fashion as I am attempting a combined blog / wiki feel with the personal notes + documentation pages I am throwing together.

After taking a look at the FilteredPageList I decided it would be nice to be able to display different page lists depending on what page I am on.

This got me thinking that it may be useful to do this on other widgets as well. I do realize that the engine allows multiple widget zones however I have yet to find a way to make widget zones specific to the current type of page I am on without adding separate master pages and messing with the current way the engine is serving content. Trying to avoid as much intrusion as possible I have decided against this approach.


If this is a decent idea and others would like the full implementation posted / included in the engine then I will sign up as a contributor and get this added in otherwise it was a good task to help further understand the blogengine.

Now to the walkthrough:

- updated the widget editor to add "displayOnServingTypes", an attribute containing a comma separated value of string representation of a new ServingType enum. Also updated the UI to include a check box list dynamically created with the available values in the ServingType enum.

- updated the URLRewrite BeginRequest method to add onto the HttpContext items the current ServingType determined by the current url.

- updated the WidgetZone onload method to compare the current ServingType against the string representation of the ServingTypes in "displayOnServingTypes" attribute if displayOnServingType is not set or does match then display the widget.


Any thoughts, tweaks, suggestions are welcome.





Jun 9, 2010 at 11:45 PM