Blocks concertina'd shut by default
arctangent opened this issue · 3 comments
arctangent commented
We would like to be able to control which ones are open and which are closed by default
BertrandBordage commented
Yes, this is one of the upcoming features :)
ladrua commented
Is it possible to have all open by default in todays version?
BertrandBordage commented
Since 1.0.0, released today, the default layout is SIMPLE
, a layout closer to the old StreamField where there is no way to collapse blocks. Blocks can still be defined as using the COLLAPSIBLE
layout by writing:
class YourBlock(CharBlock):
def get_layout(self):
return self.COLLAPSIBLE
That being said, you may want to keep COLLAPSIBLE
blocks, but opened by default.
To do that, use this:
class YourBlock(CharBlock):
def get_layout(self):
return self.COLLAPSIBLE
def get_definition(self):
definition = super().get_definition()
definition['closed'] = False
return definition