chore: updates to the content API (for use in CIBUS)

This commit is contained in:
Konstantin 2024-11-30 12:25:02 +01:00
parent 1b3a2dec72
commit 917695a1da
Signed by: konstantin
GPG key ID: A128B78773E41ACE
3 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,4 @@
from wagtail.api import APIField
from wagtail.blocks import (
CharBlock,
ChoiceBlock,
@ -14,6 +15,13 @@ class ImageBlock(StructBlock):
caption = CharBlock(required=False)
attribution = CharBlock(required=False)
api_fields = [
APIField('image'),
# Adds a URL to a rendered thumbnail of the image to the API
APIField('caption'),
APIField('attribution'),
]
class Meta:
icon = "image"
template = "base/blocks/image_block.html"