repeater_item()

Twig function of the framework; its result is HTML and is printed without escaping.

{{ repeater_item(item) }}

Marks the element of an item of a repeater (Repeater), which contains the item's inner blocks. In the block editor it becomes the inner blocks of the item being edited, or the preview of another item; on the front end it prints nothing. Only in blocks whose render() accepts a Repeater; elsewhere it throws an exception, in every render. The output is HTML: an attribute in renders for the block editor, otherwise ''.

{% for item in items %}<li{{ repeater_item(item) }}>{{ item.content|raw }}</li>{% endfor %}
ParameterTypeDefaultDescription
itemRepeaterItemrequiredAn item the block's repeater created.

Returns string