Pager doesn't preserve filtering criteria
My issue is with showing a paged result-set of Blog Posts, but I'm certain this exists in other section-controls (News, Content Items, etc.).
I've set up a page for showing historical Blog Posts, allowing the actor to filter by a specific date or a specific taxonomy item (category). Using the URL-key-prefix of 'k' the URLs are generated in the format:
http:
//<mysite>/blogs/myblog/archives/!k/2011/01/25
http:
//<mysite>/blogs/myblog/archives/?k=2
http:
//<mysite>/blogs/myblog/archives/!k/-in-Category/Categories/regions
http:
//<mysite>/blogs/myblog/archives/?k=2
http:
//<mysite>/blogs/myblog/archives/!k/2011/01/25?k=2
http:
//<mysite>/blogs/myblog/archives/!k/-in-Category/Categories/regions?k=2
Hi Anthony,
The reason for all this happening is that all URLs generated by the widgets go through route handlers. When using route handlers, anything in the URL between two slashes is part of the route. When you want multiple filter criteria, you are essentially generating a specific route. Say if you want to filter by date AND page you could generate one of two routes:
Hi Slavo -- I appreciate your thorough explanation of how the routing-engine can become confused by the filtering criteria, but I do have a couple of follow-up comments:
1. Why does the Pager control ignore the UrlEvalationMode property of its host control and always append the page-index as a query-string parameter? If I specify the mode to UrlPath, then I'd expect that the page number would be part of the URL and not the query-string, ie:
http:
//<mysite>/blogs/myblog/archives/!k/2/
http:
//<mysite>/blogs/myblog/archives/!k/-for-Date/2011/01/25/-in-Category/regions/canada/-Page/2/
Hello Anthony,
Is there any way to change that route "-in-Category" to something more simple? Maybe "category"?
Hello Conrad Ehinger,
Currently, the only way to change that URL string is to implement your own URL evaluator and implement your custom views, which use it. The reason we have an "-in-" is that these URLs are valid for all taxonomies, and not only categories and tags.
Categories and tags are just instances of the Hierarchical and Flat taxonomies, but in Sitefinity users can create their own. The URLs are implemented to work with all of them, not just the built-in ones.
Sorry to bring up an old thread, but is it possible to filter upon multiple categories or a parent category (and pull down all children category related content) when things are hierarchical?
Thanks!
Andy
Hello,
If I understood you correct, you want to have the ability to filter categories (in the Categories Grid section, in the backend of Sitefinity). At the moment you could only sort categories in the grid view of Categories by Title, URL and est.
All the best,
Stefani Tacheva
the Telerik team