Wagtail Admin Page에서 panels을 Custom 할 수 있다.
from wagtail.admin.edit_handlers import (
ObjectList,
TabbedInterface
)
class HomePage(Page):
...
# promote_panels = []
# settings_panels = []
banner_panels = [
MultiFieldPanel([
FieldPanel("banner_title"),
FieldPanel("banner_subtitle"),
ImageChooserPanel("banner_image"),
PageChooserPanel("banner_cta"),
], heading="Banner Options"),
]
edit_handler = TabbedInterface(
[
ObjectList(content_panels, heading="Content"),
ObjectList(banner_panels, heading="Banner Settings"),
ObjectList(Page.promote_panels, heading="Promotional Stuff"),
ObjectList(Page.settings_panels, heading="Setting Stuff"),
]
)
edit_handler를 통해 overide가 가능하다.
'Back-End > Wagtail, Django' 카테고리의 다른 글
Wagtail StreamField Options (0) | 2021.12.02 |
---|---|
Wagtail Custom Page Properties (0) | 2021.12.02 |
Wagtail Tags (0) | 2021.12.01 |
Wagtail Ajax Template (0) | 2021.12.01 |
Wagtail Cache (0) | 2021.11.28 |