I use a ListBlock for a custom streamfield block type as I only need one type of element and want the user to be able to dynamically add more then one of them. However, I don't want to render it as <ul><li> elements. I can specify the template, but what do I put in the template to render the list items? So I make a class like:
class CustomlGroupBlock(blocks.StructBlock):
items = blocks.ListBlock(MyCustomBlock(label="CustomBlock", template="myapp/customlistblock.html"))
Then in the template file I've unsuccessfully tried things like:
{{ self.render }} and {{ self.body }} and
{% for block in self.bound_blocks %}
{{ block.render }}
{% endfor %}
Without specifying in the template the custom blocks render fine, but wrapped in <li> elements. I need to get rid of the <ul> and <li> tags and be able to specify what wrapping html to use. In the template for CustomGroupBlock I'm using:
{{ self.bound_blocks.items.render }}
Would it be better in the template for CustomGroupBlock to iterate over items and not call render on the listblock?