diff --git a/blocks/blocks.py b/blocks/blocks.py index 63b6676c..6dc40de1 100644 --- a/blocks/blocks.py +++ b/blocks/blocks.py @@ -1,5 +1,5 @@ -from django.core.validators import validate_slug from django import forms +from django.core.validators import validate_slug from django.forms.utils import flatatt from django.utils.html import format_html, format_html_join from wagtail import blocks as wagtail_blocks @@ -44,6 +44,10 @@ class Meta: class FormattedImageChooserStructBlock(wagtail_blocks.StructBlock): image = ImageChooserBlock() + caption = wagtail_blocks.CharBlock( + required=False, + help_text="Optional caption (tooltip) to display with the image.", + ) width = wagtail_blocks.IntegerBlock( min_value=0, max_value=800, diff --git a/blocks/templates/blocks/blocks/formatted_image_block.html b/blocks/templates/blocks/blocks/formatted_image_block.html index ea22b830..4f6acb96 100644 --- a/blocks/templates/blocks/blocks/formatted_image_block.html +++ b/blocks/templates/blocks/blocks/formatted_image_block.html @@ -8,6 +8,10 @@