Search

Every so often I'm going to add a tutorial to answer a FAQ

Displaying entries from multiple sections as one

I've been asked how to do this a couple of times now, yet the solution is so simple it almost doesn't warrant posting it here:

<xsl:apply-templates select="section-a/entry | section-b/entry">
    <xsl:sort select="title" />
</xsl:apply-templates>

Simple... just select the entries you want, and then sort them by any value and the entries will come out in the correct order, regardless of what section they came from.

There's still the problem of pagination however, but I'll leave that for someone else to do.

Also:

<xsl:apply-templates select="//entry">
    <xsl:sort select="title" />
</xsl:apply-templates>

Although, there are some situations where your solution is more versatile if you want to exclude a section.

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