我正在添加一组可由我的用户在 Wagtail Admin 中填写的字段。一切正常,但我想在面板组中组织设置,但它不起作用。有人可以在下面查看我的代码,看看我这样做是否正确吗?
...
from wagtail.contrib.settings.models import BaseSetting, register_setting
from wagtail.wagtailadmin.edit_handlers import MultiFieldPanel, FieldPanel
@register_setting
class SiteSettings(BaseSetting):
facebook = models.URLField(blank=True, help_text='Your Facebook page URL')
instagram = models.CharField(max_length=255, blank=True, help_text='Your Instagram username, without the @')
youtube = models.URLField(blank=True, help_text='Your YouTube channel or user account URL')
company_name = models.CharField(blank=True, max_length=250, help_text='Enter your company name how you would like it to appear on the site')
content_panels = [
MultiFieldPanel(
[
FieldPanel('facebook'),
FieldPanel('instagram'),
FieldPanel('youtube'),
],
heading="Social Media Profiles",
classname="collapsible collapsed"
),
MultiFieldPanel(
[
FieldPanel('company_name'),
],
heading="Company Info",
classname="collapsible collapsed"
),
]