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
- Open your source newsletter in the MailPoet editor.
- Add a Text block with
[entry limit="3"]above your featured item layout. - Add a Text block with
[/entry]below it.
This section shows entries one to three.
Step 2: Add the second section
- Below the first section, add any content that appears once, such as a
More this weekheading. - Add a Text block with
[entry offset="3"], then your compact item layout, then a Text block with[/entry]. - 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
Things to watch out for
- Each section starts from the first entry. A section without
offsetshows the same entries as the section above it. Set each section'soffsetto the totallimitof 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 anoffsetand nolimitto 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 anoffset="3"section stays empty. Content between the sections, such as theMore this weekheading, still appears.