StudentMan
StudentMan

Reputation: 1

Grouping Wagtail CMS streamfield fields?

First of all, I wish everyone a good day.

I want to group blocks that I created with StreamField.

I am attaching an example video and image below.

New image

https://youtu.be/VMfxVCGarf4

Thank you for your help, best regards.

What do I want to do?

Upvotes: 0

Views: 209

Answers (1)

gasman
gasman

Reputation: 25227

Maybe the group option on the block definition is what you're looking for?

body = StreamField([
    ('title', CharBlock(group='text blocks')),
    ('paragraph', RichTextBlock(group='text blocks')),
    ('image', ImageChooserBlock(group='media blocks')),
    ('video', EmbedBlock(group='media blocks')),
])

Upvotes: 1

Related Questions