-
Templating and Integration Guide
- Part 1: Concepts
- Part 2: Modules
- Part 3: Templates and Studio
- Part 4: Content Definitions and Views
- Part 5: Advanced Techniques
- Part 6: Setting up an integration environment
- Part 7: Step by step integration
- Further reading and resources
Managing lists
General principles, displaying a generic list
In order to identify lists, the following mixin is applied to a node:
[jmix:list] mixin
Example lists defined in Jahia:
jnt:contentList, jnt:query, jnt:folder
By default, the mixin’s view will be used to display the list. This view is structured the following way:
<template:include view=”hidden.header”/>
<c:forEach items="${moduleMap.currentList}" var="subchild" begin="${moduleMap.begin}" end="${moduleMap.end}">
<template:module node=”${node}”/>
</c:forEach>
<template:include view=”hidden.footer”/>
The hidden.header and hidden.footer views make it possible to define parameters for the list to be displayed. The “hidden” prefixing the views prevent the views from being displayed in the lists of available view in the edition UI. These parameters are stored in a in a map accessible between modules named moduleMap.
The default pre-defined parameters are:
- currentList : the list of nodes to be displayed
- begin : beginning index into the list
- end : ending index (inclusive) of the list
- liveOnly : if set (boolean) an AJAX call will be used to load the list in live mode, but no editing may be done in edit mode
- subNodesView : the view to use to display the sub nodes
- editable : allows the editing of content (boolean, defauts to true)
- emptyListMessage : message to be displayed in the case of an empty list
A parameter may be set like in the following example:
<c:set target="${moduleMap}" property="subNodesView" value="${subNodesView}"/>
The hidden.header view calls a loader that will retrieve the list of nodes and stores them in the ${moduleMap} structure.
Different types of lists may be “executed”:
- Simple lists retrieved from the moduleMap under the name “currentList”
- SQL2 query retrieved from the moduleMap under the name “listQuerySql”
- DOM query retrieved from the moduleMap under the name “listQuery”
The queries are executed in the hidden.header view. The same view is also used to process sorting and filtering that is configured on a list.

