Use the Pagination element to add pagination to your View template. The Pagination element can be used to display Drupal's built in pagination for Views or use Ajax driven infinite scroll. Infinite scroll requires the contributed module Views Infinite Scroll to be installed.
Pagination is configured within Drupal's views user interface. For more information, see Creating views.
Locating the pagination element
To find the Pagination element:
- Navigate to a page or template with the Layout canvas
- Click the + button on the Layout canvas
- Within the Elements tab, look for the Pagination element.
The Pagination element includes the following fields:
- View - Select the View your template is for
- View display - Select the View display. View displays are set-up within Drupal views
- Pager - Select the pager type. Even though this is a select, there will only be one option as this is configured within the Drupal view.
- Paged output, full pager - Default full pager provided by Drupal. If selected, you can enter the content for each link and select a Custom list item style for them
- Paged output, mini pager - Default mini pager provided by Drupal. If selected, you can enter the content for each link and select a Custom list item style for them
- Infinite Scroll - Infinite scroll provided by the Views Infinite Scroll module. If selected you can choose to load content automatically as the user scrolls the page or display a button to load more content. If you choose to display a button, you can provide the button text and select a List item custom style for it.
If you use Infinite Scroll you must enable use AJAX. This is found within the Views user interface in Advanced > Use AJAX. If you choose to display a button to load more content, Views Infinite Scroll requires this to be a List. For this reason you need to create a List custom style and make it look like a button.
- Add comments - Add comments to the Element. For more information, see Adding comments to an element.