简体   繁体   English

避免简单 output - Shopify / 液体的分页限制

[英]Avoid pagination limits for simple output - Shopify / Liquid

I want to create a simple list of every article URL in my blog (I have >150).我想在我的博客中创建每篇文章 URL 的简单列表(我有 >150)。

My current code:我当前的代码:

{% for article in blogs['myblog'].articles %}
{{article.url}}
{% endfor %}

The problem is that it only outputs 50 URLs, as per the standard Shopify pagination limit.问题是它只输出 50 个 URL,根据标准 Shopify 分页限制。 How could I overcome this?我怎么能克服这个? Any solutions using Ajax or otherwise would be highly appreciated.任何使用 Ajax 或其他方式的解决方案都将受到高度赞赏。

You can overwrite the pagination limit simply by wrapping the call with the pagination tag and passing the number you want to paginate.您可以简单地通过使用分页标签包装调用并传递要分页的数字来覆盖分页限制。

{% paginate blogs['myblog'].articles by 999 %}
  {% for article in blogs['myblog'].articles %}
    {{article.url}}
  {% endfor %}
{% endpaginate %}

PS : Please note that the more articles you have the longer it will take for the DOM to load. PS :请注意,您拥有的文章越多,加载 DOM 所需的时间就越长。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM