Pagination linking tags

From GruppoZenit
Jump to: navigation, search

These pagination tags are used to split a content or a search result into pages and give the basic tools to navigate through such pages. To be paginated, a content needs the related zcms:content tag to have the attribute enablepage = "true" and the content limiting attribute datacount = "<?>".

Contents

zcms:pageprevious

This tag has information about how to validate the paging related data and check whether the previous page exists or not. This tag is just a page info validator tag and provides information to other two tags that are defined as children: zcms:pagelink and zcms:pagenolink.

Attribute Definition
name Id of the content
ref defines the reference to the ldap and full text search results.

zcms:pagenext

This tag contains information about how to validate the paging related data and check whether the next page exists or not. This tag is just a page info validator tag and provides information to other two tags that are defined as children: zcms:pagelink and zcms:pagenolink.

Attribute Definition
name Id of the content
ref defines the reference to the ldap and full text search results.

zcms:pagecurrent

zcms:pagecurrent tag can show out or store the current number of a page. This tag is composed by the following attributes:

Attribute Definition
name Id of the content or content-search

An example on the use of this tag can be the following:

<zcms:pagecurrent name="search1" />

Note: here "search1" can be the id of a content-search or a content.


zcms:pagelink

This tag stores information about how to flush the body contents when its parent tag zcms:pageprevious or zcms:pagenext returns a success value.


zcms:pagenolink

This tag has information about how to flush the body contents when its parent tag zcms:pageprevious or zcms:pagenext returns a failure.


zcms:pagetotal

This tag contains information about the total number of pages that is shown.

Attribute Definition
name Id of the content
ref defines the reference to the ldap and full text search results.

zcms:pagenumber

This tag stores information about the current page number.


Example: using of pagination linking tags

In the following example is shown how to use previosly described tags:

<zcms:pageprevious name="contentid">
   <zcms:pagelink><a href="/mypage?selpage=[zcms:pagenumber]">Prev.</a></zcms:pagelink>
      </zcms:pageprevious>
      <zcms:pagenext name=" contentid ">
   <zcms:pagelink><a  href="/mypage?selpage=[zcms:pagenumber]">Next</a></zcms:pagelink>
</zcms:pagenext>

<div>Total Page: <zcms:pagetotal name="contentid"/></div>
<div>Current page: <zcms:pagecurrent name=" contentid "/></div>

zcms:paginator

This tag can generate the next,previous and page sequence for a content model.The buttons and the page sequence can be shown and hidden according to the attribute values given to the tag.

Attribute Definition
name Required.

The id of the content model.

page Required.

The name of the page and parameters for page.

nexttext The text for next,if attribute is not used ">>" will be used as default text.
prevtext The text for previous,if attribute is not used "<<" will be used as default text.
paginatorclass The style class for the paginator tag.The whole paginator tag will be inside a 'ul' .The class will be applied for this 'ul' tag.
prevclass The class name for the previous button.
nextclass The class name for the next button.
pageactiveclass The class name for the active page in page sequence.
pageclass The class name for the page sequence.
depth The depth of the page sequence.

If "0" or attribute is not used the page sequence is not shown.


In the following example showsn how to use zcms:paginator tag:

<zcms:store var="uparam" value="23"/>
<zcms:paginator paginatorclass="pagination-2 flt-right" name="members_con" nexttext="" prevtext=""  depth="7" page="/memberspage?selpage=[zcms:pagenumber]&data=[zcms:use:uparam]"  prevclass="previous"  nextclass="next" pageactiveclass="active"/>

The URL to another page will be "memberspage?selpage=2&data=23".

"uparam" is a variable which stores the parameter value 23.

See also

Personal tools
Namespaces

Variants
Actions
Toolbox