structure:sortPages

This tag will sort a collection of pages.

Parameters

Name

Required

Default

Type

Description

id

true

 

String

The result is stored in this variable.

input

true

 

Object/String

The list of pages that are to be sorted.

sortProperty

false

NaviigationTitle

Object/String

The attribute name on the page properties to sort the pages on. Can be any of the defined ones you have on your meta info content type as well as name and publishDateTime.

sortOrder

false

asc

Object/String

Set to asc to sort in ascending order and desc to sort in descending order.

numberOrder

false

false

Object/String

Set to true if you know the values are numbers and want them sorted like numbers. Normally they are sorted like strings.

type

false

asc

Object/String

Not used for now

namesInOrderString

false

asc

Object/String

If you supply a hardcoded commaseparated string with the names of the pages that should be in what order that overrides the other sorting strategy for those items.

 

ID-result variable contains:
A sorted list of org.infoglue.deliver.applications.databeans.WebPage-objects.

Examples

The following example sorts a collection of pages on the NavigationTitle-attribute on the pages meta information.

<structure:childPages id="childPages" siteNodeId="${menuBasePageSiteNodeId}"/>
<structure:sortPages id="childPages" input="${childPages}"/>
<c:forEach var="page" items="${childPages}">
  The page id is: <c:out value="${page.siteNodeId}"/><br/>
  <a href="<c:out value="${page.url}"/>"><c:out value="${page.navigationTitle}"/></a>
</c:forEach>

The following example is a more advanced one.

<structure:childPages id="childPages" siteNodeId="${menuBasePageSiteNodeId}"/>
<structure:sortPages id="childPages" input="${childPages}" sortProperty="SortOrder" sortOrder="asc" namesInOrderString="Products ,News,Feedback"/>
<c:forEach var="page" items="${childPages}">
  The page id is: <c:out value="${page.siteNodeId}"/><br/>
  <a href="<c:out value="${page.url}"/>"><c:out value="${page.navigationTitle}"/></a>
</c:forEach>



comments powered by Disqus