kopia lustrzana https://github.com/wagtail/wagtail
Move content_panels inside BookPage definition.
rodzic
29753ecb0d
commit
fab4e2224f
|
@ -110,11 +110,10 @@ In the above example, the list of adverts is a fixed list, displayed as part of
|
||||||
related_name='+'
|
related_name='+'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
content_panels = Page.content_panels + [
|
||||||
BookPage.content_panels = [
|
SnippetChooserPanel('advert'),
|
||||||
SnippetChooserPanel('advert'),
|
# ...
|
||||||
# ...
|
]
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
The snippet could then be accessed within your template as ``page.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):
|
class BookPage(Page):
|
||||||
...
|
...
|
||||||
|
|
||||||
|
content_panels = Page.content_panels + [
|
||||||
BookPage.content_panels = [
|
InlinePanel('advert_placements', label="Adverts"),
|
||||||
InlinePanel('advert_placements', label="Adverts"),
|
# ...
|
||||||
# ...
|
]
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue