By default, wagtail's StreamField
looks something like this in the admin for empty fields, showing the different blocks available for the user:
I would however prefer it to contain a block of my choosing by default. For example:
How would I accomplish this? Setting a default
keyword argument for the field didn't seem to work.
When you tried to set a default keyword, did you set it on the RichTextBlock inside the StreamField? According to the docs, all block types accept the following optional keyword arguments: default, label, group, icon, and template. For example:
body = StreamField([
('paragraph', blocks.RichTextBlock(default='Add you content here')),
])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With