Issue
If you have a StructBlock class (used inside a StreamField)... Can you still use the Wagtail panels to group some fields (eg MultiFieldPanel) and (ideally!) use the collapsible class on the panel to hide them in some kind of "Advanced" panel?
I have tried adding the block.TextBlock
definitions into the array for a panel the, however neither the Panel nor the Fields appeared in the form.
I cant see anything in the docs about using Panels in StructBlocks:
- https://docs.wagtail.io/en/v2.8.1/reference/pages/panels.html
- https://docs.wagtail.io/en/v2.8.1/topics/streamfield.html
Solution
It's not possible to use panels inside StreamField blocks. However, by overriding form_template
on your StructBlock class you can set up whatever HTML structure you like:
Answered By - gasman
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.