diff --git a/docs/advanced_topics/customization/streamfield_blocks.md b/docs/advanced_topics/customization/streamfield_blocks.md index f658ff2c9c..f486ceac95 100644 --- a/docs/advanced_topics/customization/streamfield_blocks.md +++ b/docs/advanced_topics/customization/streamfield_blocks.md @@ -52,8 +52,8 @@ class SettingsBlock(blocks.StructBlock): icon = 'cog' # This block will be initially collapsed collapsed = True - # The label when the block is collapsed - label_format = "Settings (Theme: {theme}, Available: {available})" + # The block's summary label when collapsed + label_format = "Theme: {theme}, Available: {available}" class PersonBlock(blocks.StructBlock): diff --git a/docs/reference/streamfield/blocks.md b/docs/reference/streamfield/blocks.md index 712be72efb..352d65d539 100644 --- a/docs/reference/streamfield/blocks.md +++ b/docs/reference/streamfield/blocks.md @@ -536,7 +536,10 @@ The `form_attrs` keyword argument was added to all built-in structural block typ :param value_class: A subclass of ``wagtail.blocks.StructValue`` to use as the type of returned values for this block. See :ref:`custom_value_class_for_structblock`. :param search_index: If false (default true), the content of this block will not be indexed for searching. :param label_format: - Determines the label shown when the block is collapsed in the editing interface. By default, the value of the first sub-block in the StructBlock is shown, but this can be customized by setting a string here with block names contained in braces - for example ``label_format = "Profile for {first_name} {surname}"`` + Determines the summary label shown after the ``label`` when the block is collapsed in the editing interface. By default, the value of the first sub-block in the StructBlock is shown, but this can be customized by setting a string here with block names contained in braces - for example ``label_format = "{surname}, {first_name}"``. If you wish to hide the summary label entirely, set this to the empty string ``""``. + + .. versionchanged:: 7.1 + The block's original ``label`` is now always shown when the block is collapsed, and the ``label_format`` string is shown after it as the summary instead of replacing the ``label``. .. autoclass:: wagtail.blocks.ListBlock diff --git a/docs/releases/7.1.2.md b/docs/releases/7.1.2.md new file mode 100644 index 0000000000..82ee18d4d5 --- /dev/null +++ b/docs/releases/7.1.2.md @@ -0,0 +1,24 @@ +# Wagtail 7.1.2 release notes + +_Unreleased_ + +```{contents} +--- +local: +depth: 1 +--- +``` + +## What's new + +### Bug fixes + + * Allow `label_format` to be set to an empty string to hide the block summary label (Sage Abdullah) + +## Upgrade considerations - changes affecting all projects + +### Changes to `label_format` behavior in `StructBlock` + +In Wagtail 7.1, the `label_format` option for `StructBlock` has been changed to always show the block's original `label` when the block is collapsed, with the `label_format` string shown after it as a summary instead of replacing the `label`. This means that if you had previously set `label_format` to include (or be the same as) the `label`, you would likely want to remove the original `label`'s text from the `label_format` string. + +If you wish to hide the summary label entirely (similar to setting `label_format = label` in Wagtail < 7.1), you can set `label_format` to the empty string `""`. This was not possible in Wagtail 7.1, but is now supported as of this release. diff --git a/docs/releases/7.1.md b/docs/releases/7.1.md index f049bc4ee9..44a5356686 100644 --- a/docs/releases/7.1.md +++ b/docs/releases/7.1.md @@ -172,6 +172,12 @@ The panels mechanism used by the page and snippet editing forms now provides an * Upgrade django-tasks to 0.8.x (Jake Howard) * Refresh accessibility targets in contributing docs (Thibaud Colas) +## Upgrade considerations - changes affecting all projects + +### Changes to `label_format` behavior in `StructBlock` + +The `label_format` option for `StructBlock` has been changed to always show the block's original `label` when the block is collapsed, with the `label_format` string shown after it as a summary instead of replacing the `label`. This means that if you had previously set `label_format` to include (or be the same as) the `label`, you would likely want to remove the original `label`'s text from the `label_format` string. + ## Upgrade considerations - changes affecting Wagtail customizations ### Deprecation of `PageListingButton`, `SnippetListingButton`, and `UserListingButton` diff --git a/docs/releases/index.rst b/docs/releases/index.rst index 38fecb2b4b..ace3c887d7 100644 --- a/docs/releases/index.rst +++ b/docs/releases/index.rst @@ -7,6 +7,7 @@ Release notes upgrading release_process 7.2 + 7.1.2 7.1.1 7.1 7.0.3