Search

I have been trying to do sorting by two values. First is text type and it works, but I need to sort also by time. How I could achieve this?

For example, if I have entries that I sort by title: C, B, B, B, B, A, and then by time. The order by title should stay same, but with entries titles starting with B (or others too) shoud be ordered by time.

Like: A, B (13:00), B (14:00), ...

Figured it out. Here's an example:

First, <xsl:sort select="title" ...

Then, use <xsl:sort select="substring-before(time, ':')" ... for hours and then <xsl:sort select="substring-after(time, ':')" ... for minutes. Don't forget to order them and use number as data-type.

Until you realise you may also want to group the entries, in which case I may introduce you to Muenchian Grouping

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