Bug: Pagination in alternate template for blogs.json doesnt work

Highlighted
Shopify Partner
40 0 5

These is easily reproducible.

 

Create a blog.json.liquid and add this code: 

 

 

{% layout none %}

{% assign real_item_count = 0 %}

{% paginate blog.articles by 10 %}  
  {% capture results %}
      {% for article in blogs.blog-name.articles %}
        {% for current_tag in current_tags  %}
          {% unless article.tags contains current_tag %}
            {% continue %}
          {% endunless %}
        {% endfor %}

        {% assign real_item_count = real_item_count | plus: 1  %}

        {% unless real_item_count == 1 %},{% endunless %}
{ "title" : {{ article.title | json }} } {% endfor %} {% endcapture %} {% endpaginate %} { "result_count": {{ real_item_count }}, "results": [{{ results }}] }

 

And then hit the following url:

 

https://www.shopifystore.com/blogs/blog-name/tagged/tag?page=2&view=json

 

Results returned do not respect the pagination value in the query string. 

 

Moreover, if you have more than 50 articles with a particular tag (I had about 75), it won't ever return more than 50 regardless of whether you either adjust the pagination:

 

 

 {% paginate blog.articles by 1000 %}

 

 

...or the limit:

 

{% for article in blogs.blog-name.articles limit:1000 %}

 

 

 

0 Likes
Highlighted
Shopify Partner
40 0 5

Ignore and downvote this. You need to specify the blog to pagination. Dumb mistake.

 

{% paginate blogs.blog-name.articles by 1000 %}

 

0 Likes