Search

Hi,

How to display the data in ascending order using "Nested Category" Extension.

I am using Nested Category to create a category and Displaying the result by using this below template.

My Template Code is:

    <xsl:template name="category_listing_audio_drop_down">
    <xsl:for-each select="nested-categories/main-tree/item">
    <option value=" {.}"><xsl:value-of select="."/></option>
    </xsl:for-each>
    </xsl:template>

My Current Output is :

Amour Pardon Misericode Anges Eschatologie Israel Anges Demons Couple Enfants

I want to display the above output in ascending Order

Thank you for your solution.

Easy, use the <xsl:sort /> element.

<xsl:template name="category_listing_audio_drop_down">
    <xsl:for-each select="nested-categories/main-tree/item">
        <xsl:sort select="." />
        <option value=" {.}"><xsl:value-of select="."/></option>
    </xsl:for-each>
</xsl:template>

Thank You phoque, it works well,

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