title: Limit twig loop
body: <p>How can I make the following iteration list 5 items max only?</p>
  
  <pre><code>&lt;ul class="list-unstyled childs_2"&gt;  
  {% set wi = 0 %}
  {% for wi in wi..category.children[i]['children_level2']|length %}
  &lt;li&gt;&lt;a href="{{ category.children[i]['children_level2'][wi]['href'] }}"&gt;
  {{ category.children[i]['children_level2'][wi]['name'] }}&lt;/a&gt;
  &lt;/li&gt;  
  {% endfor %}        
  &lt;/ul&gt;
  </code></pre>