Search

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 ... Dec

For Jan(01), Nov(11), Dec(12) I would need to apply some XSL and turn them into links

&lt;a href="/2011/01/"&gt; Jan &lt;/a&gt;

and so on.

I was thinking of creating a param like so:

<xsl:param name="months" select="'01|02|03|04|05|06|07|08|09|10|11|12'"/>

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..

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.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details