Home page can now host richt content
This commit is contained in:
parent
9b4bb6c9f1
commit
38733808ed
7 changed files with 191 additions and 5 deletions
|
@ -14,6 +14,7 @@ from wagtail.snippets.models import register_snippet
|
|||
from blog.blocks import BlogPostBlock
|
||||
from wagtailseo.models import SeoMixin, SeoType
|
||||
|
||||
|
||||
class BlogIndexPage(SeoMixin, Page):
|
||||
intro = RichTextField(blank=True)
|
||||
|
||||
|
@ -29,6 +30,7 @@ class BlogIndexPage(SeoMixin, Page):
|
|||
]
|
||||
promote_panels = SeoMixin.seo_panels
|
||||
|
||||
|
||||
class BlogTagIndexPage(Page):
|
||||
|
||||
def get_context(self, request):
|
||||
|
@ -40,6 +42,7 @@ class BlogTagIndexPage(Page):
|
|||
context['blogpages'] = blogpages
|
||||
return context
|
||||
|
||||
|
||||
class BlogPageTag(TaggedItemBase):
|
||||
content_object = ParentalKey(
|
||||
'BlogPage',
|
||||
|
@ -47,6 +50,7 @@ class BlogPageTag(TaggedItemBase):
|
|||
on_delete=models.CASCADE
|
||||
)
|
||||
|
||||
|
||||
class BlogPage(SeoMixin, Page):
|
||||
date = models.DateField("Post date")
|
||||
intro = models.TextField()
|
||||
|
@ -104,6 +108,7 @@ class BlogPageGalleryImage(Orderable):
|
|||
FieldPanel('caption'),
|
||||
]
|
||||
|
||||
|
||||
@register_snippet
|
||||
class Author(models.Model):
|
||||
name = models.CharField(max_length=255)
|
||||
|
@ -121,4 +126,4 @@ class Author(models.Model):
|
|||
return self.name
|
||||
|
||||
class Meta:
|
||||
verbose_name_plural = 'Authors'
|
||||
verbose_name_plural = 'Authors'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue