File tree 4 files changed +21
-2
lines changed
4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,8 @@ class BlogListingPage(RoutablePageMixin, Page):
154
154
"""Listing page lists all the Blog Detail Pages."""
155
155
156
156
template = "blog/blog_listing_page.html"
157
+ max_count = 1
158
+ subpage_types = ['blog.VideoBlogPage' , 'blog.ArticleBlogPage' ]
157
159
158
160
custom_title = models .CharField (
159
161
max_length = 100 ,
@@ -215,6 +217,9 @@ def get_sitemap_urls(self, request):
215
217
class BlogDetailPage (Page ):
216
218
"""Parental blog detail page."""
217
219
220
+ subpage_types = []
221
+ parent_page_types = ['blog.BlogListingPage' ]
222
+
218
223
custom_title = models .CharField (
219
224
max_length = 100 ,
220
225
blank = False ,
Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ class FormField(AbstractFormField):
24
24
class ContactPage (WagtailCaptchaEmailForm ):
25
25
26
26
template = "contact/contact_page.html"
27
+ subpage_types = []
28
+ parent_page_types = ['home.HomePage' ]
29
+
27
30
# This is the default path.
28
31
# If ignored, Wagtail adds _landing.html to your template name
29
32
landing_page_template = "contact/contact_page_landing.html"
Original file line number Diff line number Diff line change @@ -12,7 +12,11 @@ class FlexPage(Page):
12
12
"""Flexible page class."""
13
13
14
14
template = "flex/flex_page.html"
15
-
15
+ subpage_types = ['flex.FlexPage' , 'contact.ContactPage' ]
16
+ parent_page_types = [
17
+ 'flex.FlexPage' ,
18
+ 'home.HomePage' ,
19
+ ]
16
20
content = StreamField (
17
21
[
18
22
("title_and_text" , blocks .TitleAndTextBlock ()),
Original file line number Diff line number Diff line change @@ -43,7 +43,14 @@ class HomePage(RoutablePageMixin, Page):
43
43
"""Home page model."""
44
44
45
45
template = "home/home_page.html"
46
- max_count = 1
46
+ subpage_types = [
47
+ 'blog.BlogListingPage' ,
48
+ 'contact.ContactPage' ,
49
+ 'flex.FlexPage' ,
50
+ ]
51
+ parent_page_type = [
52
+ 'wagtailcore.Page'
53
+ ]
47
54
48
55
banner_title = models .CharField (max_length = 100 , blank = False , null = True )
49
56
banner_subtitle = RichTextField (features = ["bold" , "italic" ])
You can’t perform that action at this time.
0 commit comments