ℹī¸Pagination

The Pagination Include

This include was designed to keep SiteBuilder layouts tidy by abstracting common pagination logic out of layouts.

It can be used to determine where in the layout the pagination layout should be displayed. Just move the tag to where you need it.

The include is an alternative to the documented Siteglide feature How to Move Pagination; it just adds a few extra SiteBuilder features.

Important The include will only output pagination if the main Liquid tag has the parameters use_pagination: 'true' and pagination_layout set. Otherwise, it will do nothing.

Example

<section class="p-8">
  <!-- Main Layout here -->
  <!-- Use the below Liquid tag to choose where your pagination will be outputted -->
  
{% include "modules\module_86\private\views\partials\front_end\includes\v1\pagination", live_updates: 'false', lock_per_page: 'true' %}



</section>

parameters

Versions

V1 - original release

The original logic inside the function is as follows. You can use this to make a copy and modify if you wish in your own layouts.

{% if live_updates == 'true' %}
  <div data-sg-live-update-component="pagination">
    <div data-sg-live-update-controls="pagination">
      {% if lock_per_page == 'true' or lock_per_page == blank %}<input type="hidden" name="per_page" value="{{per_page}}">{% endif %}
      <input type="hidden" name="show_pagination" value="{{show_pagination}}">
      <input type="hidden" name="pagination_layout" value="{{pagination_layout}}">
      {%- if _show_pagination == 'false' and pagination_layout != blank and pagination_layout != "default" -%}
        {%- include 'modules/siteglide_system/get/get_pagination', pagination_layout: _pagination_layout -%}
      {%- endif -%}
    </div>
  </div>
{% else %}
  {%- if _show_pagination == 'false' and pagination_layout != blank and pagination_layout != "default" -%}
    {%- include 'modules/siteglide_system/get/get_pagination', pagination_layout: _pagination_layout -%}
  {%- endif -%}
{% endif %}

Last updated