Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 477 Bytes

3_adding_to_a_streamfield.md

File metadata and controls

19 lines (14 loc) · 477 Bytes

Adding to a StreamField

To add the icon chooser to a StreamField, import and use the IcofontPickerBlock.

from wagtail.core.models import Page
from wagtail.core.fields import StreamField
from wagtail_icon_picker.blocks import IcofontPickerBlock


class MyStreamFieldPage(Page):
    body = StreamField([
        ('icon', IcofontPickerBlock(default="icofont-tree")),
    ])

    content_panels = Page.content_panels + [
        StreamFieldPanel('body'),
    ]