Using the lum_pagination Control
In the "Number of Items" option of the right-click on the List interfaces of Lumis, for example, the quantity of items to be displayed can be determined. In this case, the page containing the List interface will undergo pagination.
Therefore, if the List interface of the News service, for example, receives a greater number of registered items via XML than the maximum determined, the pagination information will reach the lum_pagination control in the XML:
Based on the previous XML code, there are two options to create the pagination:
- Call the existing pagination template in the DouiControls.xsl within the XSL of the List interface.
- Or, call the same template, but customize it in the XSL file where it was called.
Calling the pagination template in the XSL file of the List interface (of News):
Notes:
In addition to adding the <xsl:apply-templates />
calling the lum_pagination template, the following code was added:
This is because, for pagination to work, the following must be used <xsl:template match="//control[@type='lum_form']">
instead of just <xsl:template match="/">
, and additionally, it is necessary to have the <form>
calling the lum_formHeader template.
To simplify the code, just use the tag <lum:form />
around the code. This is one of the most recommended areas to use Lumis tags instead of normal XSL tags. (look for the example with <lum:form />
)
With the previous XSL coding, the pagination is set up. In the following example, it has been determined for the interface to display only one item per page, as can be seen in the XML of it:
The second option to create the pagination, customizing the structure and layout, should use the tag <xsl:template match="//control[@type='lum_pagination']">
. This time, <lum:form />
was used to make it easier:
At first glance, the XSL of the lum_pagination control may seem complex. This complexity is related to checks for pagination existence, number of pages, which will be the last page, existence of previous and next links, etc...
The code related to pagination was taken from the DouiControls.xsl file and some modifications were made.
With the customization of the lum_pagination control, the List interface will be displayed as follows: