<p>I'd probably try is something like this:</p>

<pre><code>&lt;div class="row small-up-1 medium-up-2"&gt;
    {# Grab all (8) stories in a random order #}
    {% set allStories = craft.entries.section('work').type('projects').order('RAND()').find() %}

    {# Now loop through only the first two items in the array #}
    {% for entry in allStories|slice(0, 2) %}
        &lt;— stuff —&gt;
    {% endfor %}
&lt;/div&gt;

&lt;div class="row small-up-2 medium-up-3"&gt;
    {# Now loop through items 3-8 in the array. #}
    {% for entry in allStories|slice(2, 6) %}
        &lt;— stuff —&gt;
    {% endfor %}
&lt;/div&gt;
</code></pre>

<p>Documentation for the Twig <code>slice()</code> method can be found here: <a href="https://twig.sensiolabs.org/doc/2.x/filters/slice.html" rel="nofollow noreferrer">https://twig.sensiolabs.org/doc/2.x/filters/slice.html</a></p>

CC BY-SA 3.0
2017-06-30T20:33:46.130Z
Thank you that worked perfectly, I had not looked at slice, much appreciated!
The Old Designer
CC BY-SA 3.0
2017-06-30T19:53:21.537Z
2017-06-30T19:53:21.537Z
Brad Bell
<p>First time here so excuse me if I get the etiquette and protocols wrong.</p>

<p>I am trying to pull eight featured stories into a page, the first two into a large two column grid and the rest into a three column grid.  Try as I may I can not get this to work... I have searched around here for various solutions but none seem to be exactly what I am trying to achieve, or I have the know how to adapt.</p>

<p>I am trying to exclude the first two entries from the second section but want the whole display to be random. I am guessing the array string of ids() is not being parsed or set up correctly but frankly I am a bit lost so any help would be very much appreciated.</p>

<p>So far I think this is the closest I have come.</p>

<pre><code>&lt;div class="row small-up-1 medium-up-2"&gt;
    {% set featuredStories = craft.entries.section('work').type('projects') %}
    {% set big = featuredStories.order('RAND()').limit(2) %}

    {% for entry in big %}
        &lt;— stuff —&gt;
    {% endfor %}
&lt;/div&gt;

{% set bigIds = big.ids() %}
{% set bigIdsString = bigIds | join(', not ') %}

{% set allEntries = featuredStories.id('and, not '~bigIdsString) %}

&lt;div class="row small-up-2 medium-up-3"&gt;
    {% for entry in allEntries %}
        &lt;— stuff —&gt;
    {% endfor %}
&lt;/div&gt;
</code></pre>

CC BY-SA 3.0
2017-07-04T17:19:00.220Z
Welcome, @TheOldDesigner! Perfect form on your first question, so naturally we all expect great things. :)
Matt Stein
<templating>
Excluding previous entries
# Excluding previous entries

(Asked by: username_0 on 2017-06-30)

First time here so excuse me if I get the etiquette and protocols wrong.
I am trying to pull eight featured stories into a page, the first two into a large two column grid and the rest into a three column grid.  Try as I may I can not get this to work... I have searched around here for various solutions but none seem to be exactly what I am trying to achieve, or I have the know how to adapt.
I am trying to exclude the first two entries from the second section but want the whole display to be random. I am guessing the array string of ids() is not being parsed or set up correctly but frankly I am a bit lost so any help would be very much appreciated.
So far I think this is the closest I have come.

    {% set featuredStories = craft.entries.section('work').type('projects') %}
    {% set big = featuredStories.order('RAND()').limit(2) %}

    {% for entry in big %}
        <— stuff —>
    {% endfor %}


{% set bigIds = big.ids() %}
{% set bigIdsString = bigIds | join(', not ') %}

{% set allEntries = featuredStories.id('and, not '~bigIdsString) %}


    {% for entry in allEntries %}
        <— stuff —>
    {% endfor %}

**Tags:** templating
> **Comments:**
> **username_1**: Welcome, @TheOldDesigner! Perfect form on your first question, so naturally we all expect great things. :)  

---

## 1 answers

### Answer by username_2 on 2017-06-30. Score: 1 | Accepted answer

I'd probably try is something like this:

    {# Grab all (8) stories in a random order #}
    {% set allStories = craft.entries.section('work').type('projects').order('RAND()').find() %}

    {# Now loop through only the first two items in the array #}
    {% for entry in allStories|slice(0, 2) %}
        <— stuff —>
    {% endfor %}



    {# Now loop through items 3-8 in the array. #}
    {% for entry in allStories|slice(2, 6) %}
        <— stuff —>
    {% endfor %}


Documentation for the Twig slice() method can be found here: https://twig.sensiolabs.org/doc/2.x/filters/slice.html

> **Comments:**
> **username_0**: Thank you that worked perfectly, I had not looked at slice, much appreciated!  

---

