List Component

Class Name

The List Component is implemented by the class

org.onehippo.cms7.essentials.components.EssentialsListComponent

Purpose

This component is used to execute a query on the documents stored in the repository, and to make the results available to the rendering template. It comes with a high degree of flexibility (parameters) to tailor the query to your needs.

The component is set up such that you can extend from it to tailor the query to your needs. The Essentials News Component and Essentials Event Component are examples for a specialization of the List Component, and may provide inspiration for your own specialized list component.

The component includes support for pagination. It provides its results as a pageable object, indicating the page size and what page number you're currently looking at.

The List component can be used in combination with facet navigation by specifying a facet navigation node in the path parameter. Note that some customized queries may not be compatible with facet navigation.

Component Parameters

Name Description
path Repository path to a folder or facet navigation node, relative to the site root folder, determining the scope (queried repository sub-tree) of the query. If not specified or empty, the repository node identified by the current request URL and site map will be used as scope.
documentTypes A comma-separated list of JCR primary node types representing the document types you want to search. Consult the available CNDs for valid values. If no document types are specified, the query will not be restrained to any node types, which is probably not what you want.
includeSubtypes Flag indicating if sub-types of the searched-for document types should be included in the query result. This flag is currently unused, sub-types are always included in the query results.
query Free-text query string to use. which document fields are searched for the query string depends on your indexing configuration. This parameter may be overruled by the request parameter.
sortField Name of the attribute of repository node representing the document (query result) to sort the results on. Check document type's bean or configuration in the CMS Document Type Editor for valid values. If you're searching for multiple document types, you typically want to specify the name of an attribute exposed by all those document types. This field has no effect when the scope of your query is a faceted navigation node.
sortOrder Flag ("desc" or "asc") indicating the sorting order. Defaults to descending sorting. This field has no effect when the scope of your query is a faceted navigation node.
page 1-based integer specifying the requested page. Default to 1 if not specified. Is overruled by request parameter.
pageSize Maximum number of results per page. Defaults to 10.
showPagination Flag indicating if the rendering template should show the pagination controls. The HST component simply passed this value through.

Request Parameters

Name Description
query Free-text query string. Doesn't currently work when querying with a facet navigation scope. Overrules component parameter.
page 1-based integer specifying the requested page. Default to 1 if none is specified. Overrules component parameter.

Rendering Attributes

Name Type Description
query java.lang.String Normalized free-text query string, originating from the request or component parameter.
pageable org.onehippo.cms7.essentials.components.paging.Pageable<HippoBean> A pageable collection containing all HippoBeans found for the requested page. The collection also provides access to the page size and number. May be null if the execution of the query failed.
Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?