Short description of issue
Pagination not working on blog object that comes from input settings
Reproduction steps
-
Create multiple blog posts to test the pagination of the blog articles (I’ve created 6 articles for the example).
-
Create a test section that has an input setting of type blog, as code below, and set it up on the homepage:
{% paginate section.settings.selected_blog.articles by 2 %}
{% for article in section.settings.selected_blog.articles %}
{{ article.title }} - {{ forloop.index }}
{% endfor %}
{% render 'pagination', paginate: paginate %}
{% endpaginate %}
{% schema %}
{
“name”: “Simple Blog”,
“tag”: “section”,
“class”: “section”,
“settings”: [
{
“type”: “blog”,
“id”: “selected_blog”,
“label”: “Selected Blog”
}
],
“presets”: [
{
“name”: “Simple Blog”
}
]
}
{% endschema %}
3) You will see that all the articles, right up to the max looping amount (50), will be displayed, and the pagination rendering amount will be ignored, as shown in attached image No. 1.
Additional info
Using the same code above on a blog page, utilizing the native blog object of the page, will yield the expected behavior of the articles rendering with the pagination tag, as can be seen in image No. 2.
In the documentation of the blog input settings, there is a note about a slight change when rendering the blog object directly for backwards compatibility, but otherwise it should be the same blog object as in a blog page and function the same using all liquid methods and properties on it.
The code above assumes that you have the common pagination block in the theme; if not, it’s not necessary for the test.
This is true for any type of Shopify theme, Dawn, or any other.
What type of topic is this
Bug report

