Repeater & Flexible Content
The Repeater fields block
The ACPT Repeater Loop block allows you to render Repeater and Flexible Content fields directly inside the Gutenberg editor. It works by defining a template — a single "loop item" — that gets repeated once for every row of data stored in the field.
Requirements
ACPT 2.x or later
A Meta Box with at least one Repeater or Flexible Content field assigned to a post type
The post type must use the Gutenberg editor
Adding the block
Open the Gutenberg editor on any post.
Click + to add a new block and search for "ACPT Repeater".
Insert the ACPT Repeater Loop block.
In the Inspector Panel (right sidebar), open General settings.
Use the Field dropdown to select a Repeater or Flexible Content field.
For Flexible Content fields, an additional Block dropdown will appear — select which layout block to render.
Once a field is selected, the block will generate a template automatically based on the field's structure.
The loop template
The template is the single "row" that ACPT will repeat for each entry in the field. It is built inside the Repeater Loop Item inner block, which accepts any Gutenberg block (paragraphs, headings, images, buttons, third-party blocks, etc.).
Inside any block within the loop item, you reference field values using tokens — placeholders wrapped in double curly braces:
When the page renders, ACPT replaces each token with the actual value for that row.
Token syntax
Basic token
Returns the default rendered output for the field type (e.g. a full <a> tag for URL fields, a formatted date for Date fields).
Dot notation — accessing sub-values
Many field types store structured data (a URL field stores both a URL and a label, an Image field stores a src, alt, title, etc.). You can target a specific property using dot notation:
Examples
Arguments — formatting modifiers
Some field types support additional formatting arguments separated by colons:
Date formatting
Accepts any valid PHP date format string.
Number formatting
Arguments: decimals : decimal_point : thousands_separator
List fields (Checkbox, Select Multi, List)
Currency, Weight, Length
Raw modifier
Append |raw to any token to bypass default rendering and return the unformatted value:
Sub-key reference by field type
URL
.url, .label
Email
(none — use args: :url, :link)
Phone
.dial, .value
Image / Video / Audio
.src, .url, .id, .alt, .title, .caption, .description, .href, .type
File
.src, .url, .id, .alt, .title, .label
Gallery / Image Slider
.src, .url, .id, .alt, .title — or numeric index: .0, .1
Address
.address, .city, .country
Currency
.amount, .unit
Weight
.weight, .unit
Length
.length, .unit
Date Range
.from, .to
Country
.country
Post Object
(none — use args: :id, :title)
Term Object
(none — use args: :id, :name)
User
(none — use args: :id, :name)
QR Code
.url, .img
Barcode
.text, .svg, .format
Practical examples
Example 1 — Simple text repeater
A repeater with two child fields: title (Text) and description (Textarea).
Template:
Output (2 rows):
Example 2 — URL field with dot notation
A repeater with a link field of type URL (stores both a URL and a label).
Template:
Output:
Without dot notation, {{link}} would render the full default <a> tag. With .url and .label separately you have full control over the markup.
Example 3 — Image field inside a card
A repeater with image (Image), name (Text), and role (Text) fields.
Template:
Output:
Example 4 — Date field with custom format
A repeater with an event_date (Date) and event_name (Text) field.
Template:
Output:
Example 5 — Currency with symbol
A repeater with a price (Currency) field.
Template:
Output:
Example 6 — Mixed token and raw modifier
A repeater with a website (URL) field used as a button href.
Template:
{{website|raw}} returns the plain URL string suitable for an href attribute, while {{website.label}} returns just the label text.
Example 7 — Flexible Content
A Flexible Content field with a block called feature containing icon (Image) and text (Text) fields.
Select the ACPT Repeater Loop block.
Set Field → your Flexible Content field.
Set Block →
feature.
Template:
Ghost preview
While editing in Gutenberg, the block renders a ghost preview — a dimmed preview of the actual data rows — below the template. This lets you verify that tokens are resolving correctly without leaving the editor.
The ghost preview updates automatically as you edit the template or add new blocks inside the loop item.
Supported inner blocks
The loop item template supports any valid Gutenberg block, including:
Core blocks: Paragraph, Heading, Image, List, Buttons, Columns, Group, Cover
Third-party blocks: GenerateBlocks, Kadence, Stackable, and others
Note: Some third-party blocks store field values in custom attributes rather than the standard
contentattribute. Token replacement works on the serialized block HTML, so tokens placed in any text or URL field of any block will be resolved correctly on the frontend.
Troubleshooting
Tokens are not replaced on the frontend Make sure the token name exactly matches the child field name (case-insensitive). Check the field name in the ACPT Meta Box editor.
The ghost preview is empty The post must have saved data for the field. The preview fetches live data — if the field has no rows, the preview will be blank.
A sub-key returns nothing Not all field types support all sub-keys. Refer to the sub-key reference table above to confirm the sub-key is valid for your field type.
The Block dropdown does not appear The Block dropdown only appears for Flexible Content fields, not Repeater fields.
The template resets after saving The template is generated automatically when you first select a field. If you need to customise it, edit the inner blocks directly — your changes are preserved on save.
Last updated