When to use `StreamBlock` vs `StructBlock`?

Viewed 17

In Wagtail, StreamBlock and StructBlock seem to serve the same purpose, which is to nest other child blocks in a parent field.

When to use one versus the other?

1 Answers

Use StructBlock if you have a known, well-defined set of sub-elements to include in a block.

Use StreamBlock when you want an variable number of content items of mixed types.

Related