'Wagtail - Change default HTML-Tag wrapper for StructBlock in StreamField

I noticed that when my StructBlocks render in the frontend, it's html template is wrapped by a div tag. I would like to change this HTML-Tag for a li tag for example.

Any possibility to do this?



Solution 1:[1]

Per the docs:

In the default rendering, each block of the stream is wrapped in a element (where my_block_name is the block name given in the StreamField definition). If you wish to provide your own HTML markup, you can instead iterate over the field’s value, and invoke {% include_block %} on each block in turn

https://docs.wagtail.org/en/stable/topics/streamfield.html#template-rendering

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 cnk