I have a custom module called "Case Studies". I want to be able to dynamically filter the list of Case Studies by the tags on each. I would like to do this filtering through the url. Whether I use url parameters or a query string, I don't care. What I want is the out of the box functionality for the build in modules that allows you to do just that. This functionality is described here (http://www.sitefinity.com/blogs/slavoingilizov/posts/11-12-12/url_filtering_in_built-in_content_widgets.aspx
In my approach I want that data to still be filtered, sorted, and paginated based on the settings that are configured in the standard designer view. I want my filtering to be included in the filtering and before the pagination.
I spent a good amount of time using JustDecompile to read through the NewsView, DynamicContentView, and their associated classes. I see the following line in the news MasterListView that does the taxonomy filtering here in the GetItemsList method:
I was looking at DynamicContentViewMaster in the GetNonPagedDataSource method and found this line:
I was hoping that this meant that I could use the UrlPath method that was used for News to filter my CaseStudies. So I tried this url:
However I get the following "Page Not Found" error:
[HttpException (0x80004005): Page not found]
Telerik.Sitefinity.Web.PageRouteHandler.handler_PreRenderComplete(Object sender, EventArgs e) +340
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5218
So that was a big no and I'm not really sure what the purpose of having that in the code is. It is obvious that the casestudy page is hit since I put a breakpoint in the widget template for OnInit and Page_Load and both are hit. So if anyone knows what is going on with that I would love to hear and explanation and a fix!
Next I tried to find a way to add a filter to the "AdditionalFilter" property on the DynamicContentViewMaster before InitializeControls was called on the same class. I'm trying to do all of this from the widget template's OnInit method. Unfortunately at this point the data source has already been set, and thus paginated, though it isn't bound.
So, any suggestions?