Created
September 15, 2016 18:14
-
-
Save tBaxter/9147f976ea8dd3bb6c7bfd49405cb37f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PageSection(models.Model): | |
columns = models.IntegerField( | |
default=1, | |
help_text="On a full-size display, how many columns would you like?" | |
) | |
section_title = models.CharField( | |
max_length=255, | |
blank=True, | |
null=True, | |
help_text="Allows you to created a headline above your blocks of content (optional)." | |
) | |
override_id = models.CharField( | |
'Override ID', | |
max_length=255, | |
blank=True, | |
null=True, | |
help_text="Create a custom ID as needed for React, etc.") | |
blocks = StreamField( | |
DemoStreamBlock(), | |
) | |
panels = [ | |
FieldPanel('columns'), | |
FieldPanel('section_title'), | |
FieldPanel('override_id'), | |
FieldPanel('blocks'), | |
] | |
class SitePageSection(Orderable, PageSection): | |
page = ParentalKey('SitePage', related_name='sections') | |
class SitePage(Page): | |
hero = StreamField( | |
HeroStreamBlock(), | |
blank=True, | |
null=True, | |
help_text="Optional. Defines hero image at top of page." | |
) | |
class Meta: | |
verbose_name = "page" | |
SitePage.content_panels = [ | |
StreamFieldPanel('hero'), # should maybe be a richtextfield. | |
InlinePanel('sections', label="Sections"), | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment