Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Plugins

How to Implement pagination Plugin in custom theme

Started by ami 7 years ago · 2 replies · 1044 views
7 years ago

I had install pagination plugin & also search plugin but I don't know how to implement in my custom theme

Could you please help me to integrate plugin.

7 years ago

I would start by reading the Readme of each plugin if you haven't already. Installed correctly, pagination should work pretty easily by adding 'pagination: true' to your collection in the frontmatter.

YAML
---
title: My Gravtastic Blog
content:
  items: '@self.children'
  order:
    by: header.date
    dir: desc
  pagination: true  // <---- this 
  limit: 10  // <---- and this
---

Simplesearch can be a little more complicated depending on what you are trying to accomplish but it usually about as simple.

👍 1
7 years ago

Since you have a custom theme you'll need this in your template.

TWIG
{% if show_pagination and config.plugins.pagination.enabled and collection.params.pagination %}
   <div id="listing-footer">
      {% include 'partials/pagination.html.twig' with {base_url: page.url, pagination: collection.params.pagination} %}
   </div>
{% endif %}

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 43 1 week ago
Plugins · by Xavier, 4 weeks ago
2 53 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1179 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 47 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 71 2 months ago