(Quick Reference)

Purpose

The wcm:eachSibling tag allows you to iterate over the siblings of the node currently being rendered.

Example

<wcm:eachSibling type="org.weceem.html.WcmHTMLContent" max="10" offset="0"  order="desc" var="sib">
  ${sib.title.encodeAsHTML()}
</wcm:eachSibling >

<wcm:eachSibling type="org.weceem.html.WcmHTMLContent" node="${org.weceem.html.WcmHTMLContent.get(68)}" max="10" offset="0" order="desc" var="sib"> ${sib.title.encodeAsHTML()}<br/> </wcm:eachSibling >

The above example will return an ordered list of sibling content in the current space relative to the current page.

Description

The supported attributes are:

  • type - name of a Content class to restrict the results to. Optional - if omitted, will return any type of child. Note that inheritence applies here so type="org.weceem.content.WcmContent" is the same as specifying no type, as all content extends WcmContent
  • node - node for searching siblings, if not specified - the current node is used
  • path - node path for searching siblings, if not specified - the current node is used
  • space - space for searching siblings, if not specified - the current space is used
  • max - maximum number of elements to return - optional, default is 50
  • offset - offset into the search results, for paging - optional, default is 0
  • sort - property of the content to sort on, eg "title" or "changedOn" - optional, will be "title" sorted if unspecified
  • order - ordering when sorting, either "asc" or "desc" - optional, asc is default
  • var - name of the variable passed to the body containing each result
  • changedSince - earliest changedOn date that a matching content node can have
  • changedBefore - latest changedOn date that a matching content node can have
  • createdSince - earliest createdOn date that a matching content node can have
  • createdBefore - latest createdOn date that a matching content node can have
  • filter - closure passed each content node, which must return true if the node is to be included in the results. Optional