-
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
Using list views
In general, only the loader view will be necessary to define a particular list type as it will load the elements to be displayed.
In the case of a query, the listQuery or listQuerySql will be setup, and in the case of a sub-node list, the currentList variable will be setup.
Example: displayed the last comment list as a component
Type definition
First we define a type that extends jmix:list
[jnt:latestComment] >jnt:content, jmix:queryContent, jmix:list, mix:title, jmix:renderableList, jmix:studioOnly, jmix:bindedComponent
- j:subNodesView (string, choicelist[templates=jnt:post,resourceBundle,image]) nofulltext itemtype = layout
Loading
The loading will be performed using a file named jnt_latestComment/html/latestComment.hidden.load.jsp . It will setup the listQuery variable in the moduleMap as illustrated here:
<query:definition var="listQuery" statement="select * from [jnt:post] as comments where isdescendantnode(comments, ['${renderContext.mainResource.node.path}']) order by comments.[jcr:lastModified] desc" ="20"/>
<c:set target="${moduleMap}" property="editable" value="false"/>
<c:set target="${moduleMap}" property="listQuery" value="${listQuery}"/>

