Home page can now host richt content

This commit is contained in:
Konstantin 2024-04-05 19:03:18 +02:00
parent 9b4bb6c9f1
commit 38733808ed
7 changed files with 191 additions and 5 deletions

View file

@ -1,9 +1,10 @@
from django.db import models
from wagtail.models import Page
from wagtail.fields import RichTextField
from wagtail.fields import RichTextField, StreamField
from wagtail.admin.panels import FieldPanel, MultiFieldPanel
from wagtailseo.models import SeoMixin
from .blocks import HomeContentBlock
class HomePage(SeoMixin, Page):
@ -34,7 +35,12 @@ class HomePage(SeoMixin, Page):
verbose_name="Hero CTA link",
help_text="Choose a page to link to for the Call to Action",
)
body = RichTextField(blank=True)
body = StreamField(
HomeContentBlock(),
blank=True,
use_json_field=True,
help_text="Write anything",
)
content_panels = Page.content_panels + [
MultiFieldPanel(