I have a doctype with a DatePicker, I want to be able to create month links like so
page.aspx?m=february or page.aspx?m=2
And pull through all the pages that have a date in February picked, but are from the current year only - I don't want to show past or future years. So February can't show events in February 2009 or 2011 etc...
Thought I would ask you XSLT ninja's as I'm sure one of you will have done this before.
Displaying Posts By Month From Current Year Only
I have a doctype with a DatePicker, I want to be able to create month links like so
page.aspx?m=february or page.aspx?m=2
And pull through all the pages that have a date in February picked, but are from the current year only - I don't want to show past or future years. So February can't show events in February 2009 or 2011 etc...
Thought I would ask you XSLT ninja's as I'm sure one of you will have done this before.
Hi there,
This should be do-able.
try checking out the EXSLT date extensions:
Exslt.ExsltDatesAndTimes:monthinyear('String d')
Exslt.ExsltDatesAndTimes:year('String d')
You can get the month name if you want instead of the numerical value
Exslt.ExsltDatesAndTimes:monthname('String d')
You can also get the query string with:
umbraco.library:RequestQueryString('m')
Hope this helps
L
Hi Lee,
Using some or all of the functions Lachlann suggests you should be able to get the year and month values
To get the pages, just select all that have a datePicker value that starts with 'YYYY-MM', e.g. (with hardcoded value):
/Chriztian
Excellent thanks
is working on a reply...