Split digest entries over sections with limit and offset

A digest can show its entries in more than one section, each with its own layout. For example, the first three entries get a large featured layout, and the rest get a compact list. You do this with the limit   and offset   options on the [entry]   marker.

Before you begin: You need a source newsletter with at least one repeating section. See How to set up repeating items in a digest.

How limit and offset work

Both options go on the opening [entry]     marker, and both are optional.

Option What it does Example
limit     Shows at most this many entries in the section. 0  or no limit  means no cap. [entry limit="3"]   
offset    Skips this many entries before the section starts. [entry offset="3"]   

You can use both on one marker. [entry limit="5" offset="3"]     skips the first three entries and shows the next five.

Step 1: Add the first section

  1. Open your source newsletter in the MailPoet editor.
  2. Add a Text block with [entry limit="3"]     above your featured item layout.
  3. Add a Text block with [/entry]     below it.

This section shows entries one to three.

Step 2: Add the second section

  1. Below the first section, add any content that appears once, such as a More this week     heading.
  2. Add a Text block with [entry offset="3"]    , then your compact item layout, then a Text block with [/entry]    .
  3. Click Save.

This section skips the three featured entries and shows the rest. Your newsletter now looks like this:

Header

[entry limit="3"]
Featured item (large image, full description)
[/entry]

More this week 
[entry offset="3"]
Compact item (title and link)
[/entry]

Footer
A MailPoet newsletter with offset and limit applied.

Things to watch out for

  • Each section starts from the first entry. A section without offset  shows the same entries as the section above it. Set each section's offset  to the total limit  of the sections above it.
  • Every eligible entry is marked as featured. This includes entries that no section shows. With 15 entries and only [entry limit="5"] , the other 10 won't appear in a later digest. End with a section that has an offset  and no limit  to show the rest.
  • {entry_count}  counts all eligible entries, not only the ones your sections show.
  • Sections fill in order. With only two eligible entries, a limit="3"  section shows both and an offset="3"  section stays empty. Content between the sections, such as the More this week  heading, still appears.