Search

When attempting to port over a theme created in 1.7, I found that data sources created with XML output grouped by date has a different format. Rather than including an element for day, this element is now omitted.

 <data>
   <entries>
     <section id="2" handle="entries">Entries</section>
     <pagination total-entries="3" total-pages="1" entries-per-page="20" current-page="1" />
     <year value="2006">
       <month value="01">
         <entry id="17" items="0">
           <title handle="tutorials-for-xslt-transformations">Tutorials for XSLT Transformations</title>
           <date time="21:00" weekday="1">2006-01-30</date>
         </entry>
       </month>
     </year>
   </entries>
 </data>

Is this intentional? I would prefer to be able to group entries posted on the same day by using the day element value to match the parameter for a page with the following URL parameters:

 year/month/day/entry/item/section

Given the XML format being produced in Symphony 2, finding the day value and grouping entries by day will be a much more convoluted process.

This was a tough decision to make. I've decided to remove the day element in favour of fewer nested elements. The decision was backed by the fact that when accessing date-grouped data, it is more often than not that a lot of data is required. The solution to grouping by day is done with using <xsl:key>.

The other reason why I've favoured this approach is that <xsl:key> will be a prominent requirement with Symphony 2, specifically when DS param output is concerned.

If you have problems with understanding how to use <xsl:key> to iterate over days, I will spend some time in creating an example code for you.

Thanks, Allen. I'll crack open my XSLT resources to find out more about xsl:key since I'm not familiar with it. An example would be great, but not if it takes you away from getting to the bug fixes and documentation. I'm sure I'll muddle through as usual.

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