How to us a URL param/query to filter a Custom Module.
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:
newsItems =
this
.EvaluateUrl<NewsItem>(newsItems,
"Taxonomy"
,
""
,
typeof
(NewsItem),
base
.Host.UrlEvaluationMode,
base
.Host.UrlKeyPrefix);
dynamicContents =
this
.EvaluateUrl<DynamicContent>(dynamicContents,
"Taxonomy"
,
""
,
base
.DynamicContentType, UrlEvaluationMode.UrlPath,
this
.UrlKeyPrefix);
|
I am using Sitefinity 5 btw.
Well, I can't figure out a good way to do this. My hack is going to be reading the settings off of the DynamicContentViewMaster in the OnInit or OnLoad of the widget template. I will then use these settings plus my url query parameters to filter the data myself and then set the results as the data source of the rad list view on my template. I will also update the pager.