MechanisM / wagtailclearstream

A work-in-progress app to make Wagtail's StreamField more modular

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wagtail Clear StreamField

This is an amended version of Wagtail's StreamField interface that introduces a new class called ClearField

  • Improved UI for nested StreamFields
  • Always visible help text
  • Confirmation on delete of StreamField items

Screenshot Screenshot

Install

  • pip install wagtailclearstream
  • Add wagtailclearstream to your installed apps
  • Use from wagtailclearstream import ClearBlock to import
  • Replace StreamBlock with ClearBlock

Examples

Separate blocks.py file

#blocks.py
from wagtailclearstream import ClearBlock

 class GlobalStreamBlock(ClearBlock):
    paragraph = RichTextBlock(
        icon="pilcrow",
        template="blocks/paragraph.html"
    )
    ...

#models.py
from .blocks import GlobalStreamBlock

class ExamplePage(Page):
    body = StreamField(
        GlobalStreamBlock(), blank=True
        )

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

About

A work-in-progress app to make Wagtail's StreamField more modular

License:Other


Languages

Language:CSS 40.3%Language:JavaScript 33.8%Language:Python 18.4%Language:HTML 7.5%