title: Twig - How to randomise items in the array and loop them?
body: <p>How can I randomise items in the array and loop them?</p>
  
  <pre><code>{% for item in article.resources|shuffle|slice(1) %}
      ...
  {% endfor %}
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>Unknown "shuffle" filter in "partials/content.twig" at line 30.</p>
  </blockquote>
  
  <p>If I use <a href="http://twig.sensiolabs.org/doc/functions/random.html" rel="nofollow noreferrer">random()</a>:</p>
  
  <pre><code>{% for item in random(article.resources|slice(1)) %}
  </code></pre>
  
  <p>Nothing is returned.</p>
  
  <p>Any ideas?</p>
  
  <p><strong>NOTES:</strong></p>
  
  <p>I don't want to use PHP btw.</p>