<p>Seems like a rather specific edge case, so I'd be surprised if there's something built in (nothing comes to mind). However, you could write a custom twig filter fairly easily to do this. </p>

CC BY-SA 3.0
2016-03-03T16:37:01.423Z
2016-03-03T16:37:01.423Z
Ben Wilkins
<p>I'm trying to get entries from two sections and merge them together which is pretty straight forward using the merge filter.</p>

<p>For example, my sections are:</p>

<ul>
<li>News</li>
<li>Promoted News</li>
</ul>

<p>But, my main issue is I only want Entry 1 from <strong>Promoted News</strong> to appear after 2 entries in <strong>News</strong> and so on (In a 2 entry increment)</p>

<p>I don't want it like this:</p>

<ul>
<li><strong>News</strong> - Entry 1</li>
<li><strong>Promoted News</strong> - Entry 1</li>
<li><strong>News</strong> - Entry 2</li>
<li><strong>Promoted News</strong> - Entry 2</li>
<li><strong>News</strong> - Entry 3</li>
<li><strong>Promoted News</strong> - Entry 3</li>
<li><strong>News</strong> - Entry 4</li>
<li><strong>Promoted News</strong> - Entry 4</li>
<li><strong>News</strong> - Entry 5</li>
<li><strong>Promoted News</strong> - Entry 5</li>
</ul>

<p>But like this:</p>

<ul>
<li><strong>News</strong> - Entry 1</li>
<li><strong>News</strong> - Entry 2</li>
<li><strong>Promoted News</strong> - Entry 1</li>
<li><strong>News</strong> - Entry 3</li>
<li><strong>News</strong> - Entry 4</li>
<li><strong>Promoted News</strong> - Entry 2</li>
<li><strong>News</strong> - Entry 5</li>
<li><strong>News</strong> - Entry 6</li>
<li><strong>Promoted News</strong> - Entry 3</li>
</ul>

<p>I thought about doing it using a conditional and incrementing a variable, but I don't think this would work with pagination so I need to merge them in to one array.</p>

<p>Is it possible to do this? My heads mashed thinking about doing this...</p>

<p>Thanks!</p>

CC BY-SA 3.0
2017-08-27T15:10:13.523Z
Hi Jason, did you ever get an answer to this? I am trying do something similar but with two different entry types, Thanks.
Gareth
CC BY-SA 3.0
2017-09-01T09:44:16.660Z
Sadly not :( I did consider writing a plugin to do this, but we never got round to it.
Jason Mayo
<entries><merge>
Merge Entries but only after X amount of entries
# Merge Entries but only after X amount of entries

(Asked by: username_0 on 2016-03-03)

I'm trying to get entries from two sections and merge them together which is pretty straight forward using the merge filter.

For example, my sections are:

* News
* Promoted News

But, my main issue is I only want Entry 1 from **Promoted News** to appear after 2 entries in **News** and so on (In a 2 entry increment)

I don't want it like this:

* **News** - Entry 1
* **Promoted News** - Entry 1
* **News** - Entry 2
* **Promoted News** - Entry 2
* **News** - Entry 3
* **Promoted News** - Entry 3
* **News** - Entry 4
* **Promoted News** - Entry 4
* **News** - Entry 5
* **Promoted News** - Entry 5

But like this:

* **News** - Entry 1
* **News** - Entry 2
* **Promoted News** - Entry 1
* **News** - Entry 3
* **News** - Entry 4
* **Promoted News** - Entry 2
* **News** - Entry 5
* **News** - Entry 6
* **Promoted News** - Entry 3

I thought about doing it using a conditional and incrementing a variable, but I don't think this would work with pagination so I need to merge them in to one array.

Is it possible to do this? My heads mashed thinking about doing this...

Thanks!

**Tags:** entries, merge

> **Comments:**
> **username_1**: Hi Jason, did you ever get an answer to this? I am trying do something similar but with two different entry types, Thanks.  
> **username_0**: Sadly not :( I did consider writing a plugin to do this, but we never got round to it.  

---

## 1 answers

### Answer by username_2 on 2016-03-03. Score: 1

Seems like a rather specific edge case, so I'd be surprised if there's something built in (nothing comes to mind). However, you could write a custom twig filter fairly easily to do this.


---

