Start page / Template development / Template syntax / System objects / #global / Multiple pages

#global and multiple pages

Data source based sections can be created in the Page Store. The special feature of pages which contain such sections is that the set of datasets can be distributed.

In the Site Store the corresponding page reference has a tab Data. In this tab it is possible to specify how many datasets are to be generated in a page and the maximum number of pages to be generated.

Pages generated by distribution of the dataset are called Multiple pages (multipages).

This concept not only exists for data source based sections but in other places too.

To determine information from Multiple pages, there are two methods:

  1. .multiPageParams() (In general: Information of all generated pages)
  2. .pageParams() (In general: Information of one generated page)

Information of all pages (multiPageParams)

The method multiPageParams can be used to query and further process information on all generated pages of a multiple page (e.g. number of pages).

The basic structure of multiPageParams looks like this:

$CMS_VALUE(#global.multiPageParams[.METHOD])$

The following table lists the most important invocations of multiPageParams:

Invocation

Meaning

Return data type

#global.multiPageParams.pageCount

Returns the total number of pages.

Integer

   

Information of a page (pageParams)

The method pageParams can be used to invoke information on the currently generated page.

The general syntax of pageParams is:

$CMS_VALUE(#global.pageParams[.METHOD])$

The most important invocations of pageParams are given in the following table.

Invocation

Meaning

Return data type

#global.pageParams.index

Returns the current page number. The counting begins with 0.

Integer

#global.pageParams.isFirst

Determines whether the current page is the first of all pages.

Boolean
(Boolean value)

#global.pageParams.isLast

Determines whether the current page is the last of all pages.

Boolean
(Boolean value)

   

Data source based invocations

In addition to the general methods which can be invoked on a multiple page there are other methods for data source based pages.

The following list names the most important of them:

Invocation

Meaning

Return data type

#global.node.content2Params.query.
selectStatement.parameters

Returns all parameters of the query.

Collection<Parameter>

#global.node.content2Params.getSelect(#global.language).
parameterValue("IDENTIFIER")

Returns the value of a query parameter.

String
(character string)

#global.node.content2Params.query.
selectStatement.parameterValue("IDENTIFIER")

Returns the default value of a query parameter.

String
(character string)

#global.node.content2Params.query.
selectStatementAsString

Returns the used query of the multiple page.

String
(character string)

#global.node.content2Params.tableTemplate.id

Returns the ID of the table template used in the multiple page.

Long

#global.node.content2Params.tableTemplate.templateId

Returns the template ID of the table template used in the multiple page.

Long

#global.multiPageParams.data

Returns a list of all datasets of the multiple page.

List<Entity>

#global.multiPageParams.data.get(INTEGER)

Returns the given dataset from the list. The parameter must be specified as an integer. If an integer is given which is greater than or equal to the number of datasets this results in an error:
ERROR: Index: 5223, Size: 7...

Entity

#global.multiPageParams.data.size

Number of all datasets of the multiple page.

Integer

#global.multiPageParams.entitiesPerPage

Returns how many datasets are to be displayed on a page (setting Number of entries per page).

Integer

#global.pageParams.data

Returns all datasets of a page as a list.

List<Entity>

#global.pageParams.data.get(INTEGER)

Returns the given dataset from the list. The parameter must be specified as an integer. If an integer is given which is greater than or equal to the number of datasets this results in an error:
ERROR: Index: 5223, Size: 7...

Entity

#global.pageParams.data.size

Number of all datasets of a page of the multiple page.

Integer

#global.pageParams.offset

Returns how many datasets were output before the current page.

Integer

   

Examples

Several examples of use of the instruction within templates are shown in the following. The examples are intended to clearly show the specific effect of the instruction and provide help for the template developer when creating their own templates.

Important The examples displayed here must be adjusted for use within a project! For example, variable names must be changed to the specific variable names of the project in which the instruction is to be used.

1st Example: Offsetting datsets on the basis of the page number (offset)

Offset:$CMS_VALUE(#global.pageParams.offset)$

The example calculates, on the current page, how many entries were displayed on the previous pages. The calculation only makes sense if the user selected the number of entries per page larger than 0. 0 would mean that all entries would be displayed on one page.

Exemplary output:

Offset:6

© 2005 - 2024 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2024.11 | Data privacy