content:contentSort

This tag will allow you to sort a collection of contents in any number of ways.

Parameters

Name

Required

Default

Type

Description

id

true

 

String

The result is stored in this variable.

input

true

 

String/Object

The collection to sort

comparatorClass

false

 

String/Object

Can be used to state a custom comparator-class

 

ID-result variable contains:
A sorted list of org.infoglue.cms.entities.content.ContentVO-objects.

Examples

The following example gets all the child content to a folder bound by the component property "ArticleFolder" and sorts them first on the Title attribute found in each version and then secondly on the publishDateTime so the come in date order if they have the same Title.

<content:childContents id="articles" propertyName="ArticleFolder"/>
<content:contentSort id="sortedArticles" input="${articles}">
  <content:sortContentVersionAttribute name="Title" className="java.lang.String" ascending="false"/>
  <content:sortContentProperty name="publishDateTime" ascending="false"/>
</content:contentSort>



comments powered by Disqus