Skip to content

Stack slots

A stack slot is a slot whose content editors build in each edition: an ordered list of child slots, each a rich text, curated, ad or image slot rendered by its own block. One edition can hold three story lists there, the next a long essay and two ads, and neither needs a deploy.

Editors add children from the stack slot’s palette: slot configs your organization sets up and deploys. Every block, story limit and ad tag in an edition is one you set up.

A stack slot is part of the publication’s setup, so a change to it takes effect on deploy. It sets no block and no props: each child names its own block. Its three settings:

Setting What it holds
max The most children it holds in one edition, from 1 to 50.
palette What an editor can add, by key. Each entry is a slot config: kind (rich_text, curated or ad), block, and optionally title, props and maxItems.
start The children each new edition starts with, in order, at most max. Each is a slot config whose kind and block a palette entry has, or ad: <key> for an ad entry.
  • A palette entry is checked as a slot on the publication is: its block must accept its kind and its props, and a curated entry holds 1 to 50 stories.
  • A palette key is a lowercase letter, then lowercase letters, digits and hyphens.
  • A start entry can set its own title, props and story limit. Its kind and block must match a palette entry, so an editor can add that child again after removing it.
  • A child cannot be a feed slot or another stack slot.

In a publication’s file in a config tree:

publications/example.com/daily.yaml
slots:
lead:
kind: curated
block: story-list-hero
maxItems: 1
body:
kind: stack
max: 20
palette:
text:
kind: rich_text
block: rich-text
stories:
kind: curated
block: story-list-hero
maxItems: 3
cards:
kind: curated
block: story-cards
maxItems: 6
props:
headlineFont: sans
ad-mid:
kind: ad
block: ad-unit
props:
adProvider: liveintent
units:
- href: https://sli.example.com/click?s=1001&m={email_md5}&p={edition_id}
src: https://sli.example.com/imp?s=1001&m={email_md5}&p={edition_id}
width: 600
alt: Advertisement
start:
- kind: rich_text
block: rich-text
title: The World Today
- kind: curated
block: story-list-hero
maxItems: 1
props:
showByline: true
- ad: ad-mid
footer:
kind: rich_text
block: rich-text

An ad in start names its palette entry, ad: ad-mid, and does not repeat the tag. max and palette are required. Without start, each new edition’s stack slot starts empty.

An edition renders at most 50 slots, and a stack slot counts as its max, however many children an edition gives it. With 10 other slots, a stack slot’s max can be 40, not 41. A save over the limit is refused:

An edition renders at most 50 slots, each stack slot counted at its max. Remove a slot or lower a stack slot's max.

A new edition starts with the stack slot’s start children, in order. While the edition is a draft or scheduled, an editor can:

  • Add a child from the palette, between two children or after the last, up to max. It takes the entry’s kind, block, title, settings and story limit, and starts empty. Once the stack slot holds max children, add is off and says why.
  • Duplicate a child: another child from the same palette entry goes right after it. It starts empty.
  • Remove a child, with its text or stories.
  • Drag a child to a new place. Without a mouse, move it up or down one place from its menu.

Adding, duplicating, moving and removing a child are saved at once. Text, stories, titles and settings are saved with the rest of the edition.

Each child is edited like any other slot: its text or its stories, its title, and the settings its block lets an editor change. A child is not linked to a slot on the publication, so a change to the publication never overwrites its title or settings.

An ad child is a copy of its palette entry, tag included. An editor picks an ad entry and never pastes a tag, so every ad URL in an edition is one your organization set up. See Ad slots.

A deploy changes the palette, never an edition’s children

Section titled “A deploy changes the palette, never an edition’s children”

A deploy that changes a stack slot’s palette, max or start changes what a new edition starts with, and what an editor can add from then on. It never changes the children an edition already has: each keeps its content, stories, title and settings, even when the deploy removed its palette entry.

A child whose palette entry the deploy removed, renamed, or changed to another kind or block fails Checks by name and blocks scheduling:

Stack slot "Main": "Weekend picks" is no longer in its palette. Remove it.

An edition already scheduled fails its send with the same reason, until an editor removes the child.

Before any render, whether the email, the web archive, the preview or a test send, EdgeKit replaces each stack slot with its children, in order. A template gets ordinary slots, numbered by their place in the edition:

publication slots: lead | body (stack slot) | footer
body's children: text, cards, ad-mid, text
what renders: lead | rich text | curated | ad | rich text | footer positions 0 to 5
  • EdgeKit’s templates render the children as they render any slot, in order.
  • A feed slot leaves out the stories a curated child holds, as it does a curated slot’s.
  • An empty stack slot adds no content, and neither do ad children. An edition whose slots hold nothing but ads is not sent; see Write an edition.
  • An experiment varies top-level slots only, never a child.
  • {slot} in a link template is the child’s place in the email, counting from 1. It changes when an editor reorders the children, so one {slot} value can mean a different child in each edition.
  • {slot_key}, in a link template or an ad’s URL, is the same in every edition: a slot’s key, or for a child, its stack slot’s key. Compare editions by {slot_key} and block, never by {slot}. Like {slot}, it is left off links outside every slot and off every link a custom template renders.

A custom template declares the blocks it lays out with blocks in defineTemplate, and a template without blocks takes no stack slot. EdgeKit’s own templates declare every block. A push of a template that declares blocks also renders the stack fixture: one child for each block it declares.

A deploy is refused while a stack slot’s palette offers a block that an active variant’s custom template does not declare, at the version the deploy makes active. The refusal names the variant, the template and each missing block:

Publication "The Daily": variant "Main" renders "custom:digest", whose version in this deployment does not declare block "story-cards", which a stack slot's palette offers, and a template renders only the blocks it declares. Push a version that lists it in defineTemplate's blocks, or remove it from the palette.

Add the block to blocks in defineTemplate, push the template again, then deploy. Or remove the entry from the palette. See When a deploy is refused.

Each child reaches the template with stack, the stack slot’s key, so a template can frame the children. See What a template receives.

edgekit.ai