Skip to content

Commit

Permalink
Exposing Custom Page Fields to the v2 API
Browse files Browse the repository at this point in the history
  • Loading branch information
KalobTaulien committed Mar 19, 2019
1 parent 8988bd8 commit 9ce96e6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions home/models.py
Expand Up @@ -3,6 +3,7 @@

from modelcluster.fields import ParentalKey

from wagtail.api import APIField
from wagtail.admin.edit_handlers import (
FieldPanel,
MultiFieldPanel,
Expand Down Expand Up @@ -57,6 +58,13 @@ class HomePage(RoutablePageMixin, Page):

content = StreamField([("cta", blocks.CTABlock())], null=True, blank=True)

api_fields = [
APIField("banner_title"),
APIField("banner_subtitle"),
APIField("banner_image"),
APIField("banner_cta"),
]

content_panels = Page.content_panels + [
MultiFieldPanel(
[
Expand Down

1 comment on commit 9ce96e6

@KalobTaulien
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.