stk:pagination.create-menu(template)

element()?stk:pagination.create-menu
  1. element()contents
  2. xs:integerindex
  3. xs:integercontent-count
  4. xs:integertotal-count
  5. xs:integercontents-per-page
  6. element()*parameters
  7. xs:integerpages-in-pagination
  8. xs:stringindex-parameter-name
  9. xs:stringshow-more-text
  10. xs:stringshowing-text

Examples

Input

<xsl:call-template name="stk:pagination.create-menu">
    <xsl:with-param name="contents" select="/result/articles/contents"/>
</xsl:call-template>

Result

<nav class="pagination" aria-labelledby="d80802e110" data-count="10" data-totalcount="34" data-windowurl="https://enonic.com/stk/template-reference/xslt/pagination/stk-pagination.create-menu/_window/doc-show?index=REPLACEWITHINDEX" data-show-more-text="Show #count more" data-showing-text="Showing #count of #totalcount">
  <h4 id="d80802e110" class="audible">Pagination</h4>
  <ul>
    <li class="number first-page active">
      <span>
        <span class="audible">Page</span>1
      </span>
    </li>
    <li class="number">
      <a href="https://enonic.com/stk/template-reference/xslt/pagination/stk-pagination.create-menu?index=10&amp;key=70" rel="next">
        <span class="audible">Page</span>2
      </a>
    </li>
    <li class="number">
      <a href="https://enonic.com/stk/template-reference/xslt/pagination/stk-pagination.create-menu?index=20&amp;key=70">
        <span class="audible">Page</span>3
      </a>
    </li>
    <li class="number">
      <a href="https://enonic.com/stk/template-reference/xslt/pagination/stk-pagination.create-menu?index=30&amp;key=70">
        <span class="audible">Page</span>4
      </a>
    </li>
    <li class="next">
      <a href="https://enonic.com/stk/template-reference/xslt/pagination/stk-pagination.create-menu?index=10&amp;key=70" title="Next" rel="next">Next</a>
    </li>
    <li class="last">
      <a href="https://enonic.com/stk/template-reference/xslt/pagination/stk-pagination.create-menu?index=30&amp;key=70" title="Last page">Last page</a>
    </li>
  </ul>
</nav>

For enabling AJAX pagination

Input

/* The first parameter is the content list, the second parameter is the pagination element */
STK.pagination.clickLoad($('.article-list > ol'), $('.article-list > nav.pagination'));

Parameters

contents
Type
element()
index
Type
xs:integer
Default
xs:integer($contents/@index)
content-count
Type
xs:integer
Default
xs:integer($contents/@resultcount)
total-count
Type
xs:integer
Default
xs:integer($contents/@totalcount)
contents-per-page
Type
xs:integer
Default
xs:integer($contents/@count)
parameters
Type
element()*
Default
$stk:querystring-parameter[not(@name = 'index' or @name = 'id' or starts-with(@name, '_config-'))]
pages-in-pagination
Type
xs:integer
Default
10
index-parameter-name
Type
xs:string
Default
'index'
show-more-text
"Show #count more" text for AJAX pagination
Type
xs:string
Default
portal:localize('stk.pagination.show-more-text')
showing-text
"Showing #count of #totalcount" text for AJAX pagination
Type
xs:string
Default
portal:localize('stk.pagination.showing-text')