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

Pagination not working

Started by Muut Archive 10 years ago · 7 replies · 1955 views
10 years ago

Hello there,

i have a Problem using the pagination plugin. I did everything as described at the github-page. I'm using the pagination inside a modular page. The definition of the collection is also made in the .md-file of the modular page.

---markup
content:
items:
'@taxonomy.category': blogitem
order:
by: date
dir: desc
pagination: true
limit: 3

pagination: 'true'

YAML

While debugging i could see there are entries in my collection. I can see the entries on my page. The limitation works fine as well, but at the end of the page there is no pagination. =/ Pagination only shows up, when I made following changes:

---markup
content:
  items:
    '@taxonomy.category': blogitem
  order:
    by: date 
    dir: desc
  pagination: 'true'
  limit: 3

pagination: 'true'

But it's still not working. there are no clickable links - just grey icons. I implemented the pagination like this:

---twig
{% set settings = {} %}
{% set collection = page.collection() %}

{% if header.bloglist %}
{% set settings = header.bloglist %}
{% endif %}

{% if page.header.bloglist %}
{% set settings = settings|merge(page.header.bloglist) %}
{% endif %}

<div class="modular-row">
<div class="content-wrapper blog-content-list" >
<div id="listing" class="pure-g h-feed">
{% for child in collection %}
{% include 'partials/blog_item.html.twig' with {'blog':page, 'page':child, 'truncate':true} %}
{% endfor %}

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

</div>
</div>

TXT

I don't get whats wrong. Can somebody help me? It seems the pagination-template requires somekind of pagination object, but there is none.

Regards, 

Michael
---
10 years ago

Rather than trying to debug this via the forum, why don't you download the blog-site skeleton from the downloads and compare your setup to that. That is probably the best way to see what you are missing.

10 years ago

That's what I did. The pagination works on a normal template (like in the blog-timplate I downloaded). But in a modular site not. Sorry, I just try to find the reason why ...

10 years ago

Perhaps you could ZIP up your site and send me a link so i can try it on my local?

10 years ago

Hello rhuskter,
I rebuild my template from modular to a normal one. It was the easiest way around the problem. But it's not statisfying. ;D

10 years ago

Does pagination technically work for modular components? Would it just end up paginating that specific component?

10 years ago

Generally speaking you wouldn't ever want to paginate with modular subpages, as these are just building-blocks for another page.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 2001 9 years ago
Archive · by Muut Archive, 9 years ago
2 1342 9 years ago
Archive · by Muut Archive, 9 years ago
2 4550 9 years ago
Archive · by Muut Archive, 9 years ago
1 3403 9 years ago
Archive · by Muut Archive, 9 years ago
3 1494 9 years ago