Nice one Lee - already had uComponents installed, so I'll get stuck in.
Umbraco is by far the best CMS I've ever used for the kind of sites I develop - everything I need seems to be so easily achievable, as opposed to hours digging through standard .NET's bloated and idiosyncratic codebase...
Sorry Lee, I can't seem to get this working. I have no idea what's going wrong, but the XSLT file can't be parsed and it's down to the for-each statement involving ListDates(). The FormatDateTime() function works fine. The dates being supplied are in the format I mentioned in my OP. I even tried hardcoding dates into the function call, but I still get a parser error. Umbraco's XSLT editor pane doesn't show any errors and I'm not sure how else to debug.
Extension object 'urn:ucomponents.dates' does not contain a matching 'ListDates' method that has 2 parameter(s).
I'm guessing this means I need to update to 2.2 Beta 3. If so, do I need to uninstall the current version, and will this affect the content that uses uComponents datatypes?
We've been adding so much stuff to uComponents recently, I can't remember when that XSLT extension was introduced. :-$
As for upgrading uComponents - it's literally replacing the "uComponents.Core.dll" (make a back-up of your current one). The DLL will have a Guid name in the package download ZIP ... just rename that to "uComponents.Core.dll".
Pattern for each date between two dates
Hi,
Hope someone can help - I'm a relative newcomer to XSLT and I haven't fully grasped the best practice for dealing with a requirement like this:
I have an Event node with two dates and some other info; let's simply to a start date, an end date and a title.
What I need in my XSLT is a loop which will output the title and the date for each date between and including the start and end date.
E.g. for the following node:
I need the following output:
Any help would be most appreciated.
TIA
P.S. I need this to be able to span calendar months; e.g. startDate: 2011-10-31, endDate 2011-11-02
Hi Tom,
In uComponents we have an XSLT extension for Dates, there is a method called "ListDates", which can be used like this:
Cheers, Lee.
Nice one Lee - already had uComponents installed, so I'll get stuck in.
Umbraco is by far the best CMS I've ever used for the kind of sites I develop - everything I need seems to be so easily achievable, as opposed to hours digging through standard .NET's bloated and idiosyncratic codebase...
Cool, happy to be of help.
PS. Don't forget to mark the post as solution ;-)
Sorry Lee, I can't seem to get this working. I have no idea what's going wrong, but the XSLT file can't be parsed and it's down to the for-each statement involving ListDates(). The FormatDateTime() function works fine. The dates being supplied are in the format I mentioned in my OP. I even tried hardcoding dates into the function call, but I still get a parser error. Umbraco's XSLT editor pane doesn't show any errors and I'm not sure how else to debug.
My precise code is:
It's outputting for JSON.
Add a ?umbdebugshowtrace=true to the url to find out the exact parser error on the frontend, should give you a clue at least of what is wrong.
Cheers,
/Dirk
Just done that - here's the issue:
Extension object 'urn:ucomponents.dates' does not contain a matching 'ListDates' method that has 2 parameter(s).
I'm guessing this means I need to update to 2.2 Beta 3. If so, do I need to uninstall the current version, and will this affect the content that uses uComponents datatypes?
Hi Tom,
We've been adding so much stuff to uComponents recently, I can't remember when that XSLT extension was introduced. :-$
As for upgrading uComponents - it's literally replacing the "uComponents.Core.dll" (make a back-up of your current one). The DLL will have a Guid name in the package download ZIP ... just rename that to "uComponents.Core.dll".
Cheers, Lee.
Seems to be in the v2.2 branch (not in trunk)...
Cheers,
/Dirk
Yup, we're working from /branches/v2.0/ :-)
Thanks again guys, all working now.
I had to make a slight tweak to your code; here it is for the next person who wants to list dates using this method:
Cool, glad it's working... that's what I get for writing the XSLT/XPath off the top of my head! ;-)
is working on a reply...