mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-18 14:00:59 +00:00
Move content_panels inside BookPage definition.
This commit is contained in:
parent
29753ecb0d
commit
fab4e2224f
1 changed files with 8 additions and 10 deletions
|
|
@ -110,11 +110,10 @@ In the above example, the list of adverts is a fixed list, displayed as part of
|
|||
related_name='+'
|
||||
)
|
||||
|
||||
|
||||
BookPage.content_panels = [
|
||||
SnippetChooserPanel('advert'),
|
||||
# ...
|
||||
]
|
||||
content_panels = Page.content_panels + [
|
||||
SnippetChooserPanel('advert'),
|
||||
# ...
|
||||
]
|
||||
|
||||
|
||||
The snippet could then be accessed within your template as ``page.advert``.
|
||||
|
|
@ -152,11 +151,10 @@ To attach multiple adverts to a page, the ``SnippetChooserPanel`` can be placed
|
|||
class BookPage(Page):
|
||||
...
|
||||
|
||||
|
||||
BookPage.content_panels = [
|
||||
InlinePanel('advert_placements', label="Adverts"),
|
||||
# ...
|
||||
]
|
||||
content_panels = Page.content_panels + [
|
||||
InlinePanel('advert_placements', label="Adverts"),
|
||||
# ...
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue