user3513237 user3513237 - 3 years ago 76
HTML Question

Liquid template get around maximum results returned

I am using html and liquid to customize a template on a site called freshdesk, and I have an issue where only the first 30 results are returned. I seem to think there is a way around this, maybe by looping through data in smaller chunks, however I have not found a solution so far. Are there any tricks to break this up to look at 30 (or less) result chunks or something like that?

Here is an example code (simplified). This should show all articles, however it only shows the first 30.

{% for article in folder.articles %}
<li><a href="{{ article.url }}">{{ article.title }}</a></li>
{% endfor %}

Answer Source

I answered my own question. I figured out that I can wrap this in paginate before the for loop and it seems to get around the 30 limit. I tried 500, and it seems to work just fine, although I have no more than 75 or so articles in each folder.

{% paginate folder.articles by 500 %}
    {% for article in folder.articles %}
        <li><a href="{{ article.url }}">{{ article.title }}</a></li>
    {% endfor %}
{%endpaginate%}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download