5 users online. Create an account or sign in to join them.Users
Union Datasource, splitting strings and dates
This is an open discussion with 1 reply, filed under XSLT.
Search
If there's a date field in each datasource the Union Datasource should handle the sorting for you (provided your sorting on that field in the first place!). If it doesn't, that's a bug.
I think however you're talking about grouping? If that's the case, in the past I've just done this in PHP. I had a tight deadline and my XSLT knowledge wasn't good enough to figure it out, so this thread is interesting for me too :D
Create an account or sign in to comment.
I'm using Brendo's Union Datasource to merge two datasources together. The resulting datasource is a mix of links that I need to organise by date. Since Brendo's extension doesn't currently support this I need to come up with another solution.
Example DS:
<bookshelf-latest> <section id="4" handle="bookshelf-clippings">Bookshelf Clippings</section> <entry id="159"> <title mode="unformatted" handle="in-the-mood-for-kitchens-with-character" word-count="7"><![CDATA[In the Mood for Kitchens with Character]]></title> <date> <date timeline="1" type="exact"> <start iso="2011-07-02T00:00:00+00:00" time="00:00" weekday="6" offset="+0000">2011-07-02</start> </date> </date> <date-format> <item handle="full-date-1-january-2011">Full Date (1 January 2011)</item> </date-format> <snippet mode="formatted" handle="kitchens-have-been-coming-up-a-lot-recently-as-i-excitedly-reconsider-my-own-i-ve-also-been-working-on-a-few-for-clients-and-have" word-count="25"><p>Kitchens have been coming up a lot recently. As I excitedly reconsider my own, I’ve also been working on a few for clients, and have…</p></snippet> </entry> </bookshelf-latest>The other dilemma I have is that I need to show a full list of months for all the years available, and turn only the active months into links.
For example, the Union Datasource has the following years and months respectively: 2011 (01,11,12), 2010 (01,02)
I need to output something like this:
2011: Jan, Feb, Mar ... Dec 2010: Jan, Feb, Mar ... DecFor Jan(01), Nov(11), Dec(12) I would need to apply some XSL and turn them into links
<a href="/2011/01/"> Jan </a>and so on.
I was thinking of creating a param like so:
Then running a sort of split function over it, running it through date-time.xsl to return months, and then checking that month (somehow) against the DS. If the DS has at least one month that matches the current one, then activate the link.
I know it's all a bit sparse, but any guidance would be greatly appreciated..