you could use umbraco.library:RequestForm() to request the value of your select box on post back and then use the value to filter your results against the year part of the publication date of your entries
I'd implement this with a GET form that appends the variable year to the URL (e.g. ?year=2009)
In the XSLT that renders the items you could then use umbraco.library:RequestQueryString('year') to get the selected value (if any) and filter the result by adding a predicate like the following to the XPath that selects the nodes to render; something like:
You know, i discovered Umbraco two weeks ago and it was love at first sight. Finally a CMS where the only limit is your imagination...Well, and your programming skills :)
I am working with XSLT for the first time and i do like it's potential for transforming XML structures. But im a totally newbie so Chriztian, if you can send me any example would b great.
Filter entries with a select box in frontend
Hello:
I want to filter entries of a page by year using a select box in frontend (public website), so the user can filter the info of his interest.
You can check the following example:
Thanks a lot for your help!!
Ivan
you could use umbraco.library:RequestForm() to request the value of your select box on post back and then use the value to filter your results against the year part of the publication date of your entries
Hi Ivan,
I'd implement this with a GET form that appends the variable year to the URL (e.g. ?year=2009)
In the XSLT that renders the items you could then use umbraco.library:RequestQueryString('year') to get the selected value (if any) and filter the result by adding a predicate like the following to the XPath that selects the nodes to render; something like:
(Obviously, you'd render the selectbox with the chosen year pre-selected as a courtesy to the user)
Hope this gets you going, and feel free to ask for detailed examples if needed.
/Chriztian
Thanks a lot guys!!
You know, i discovered Umbraco two weeks ago and it was love at first sight.
Finally a CMS where the only limit is your imagination...Well, and your programming skills :)
I am working with XSLT for the first time and i do like it's potential for transforming XML structures. But im a totally newbie so Chriztian, if you can send me any example would b great.
Thanks again for your help.
Ivan
Something like this can do it:
Not tested, but have something similiar for my Simple Search 4 Umbraco...
hth, Thomas
I will give it a try, Thomas.
Thanks ;-)
is working on a reply...