Home

Awesome

wagtail_blocks wagtail

PyPI Build Documentation Status PyPI - License

Downloads Downloads Month Downloads Week

A Collection of awesome Wagtail CMS stream-field blocks and Charts.

Check out Awesome Wagtail for more awesome packages and resources from the Wagtail community.

Quickstart

You must have your Wagtail project up and running:

pip install wagtail_blocks

Add the following enteries to your settings.py in the INSTALLED_APPS section:

'wagtailfontawesomesvg',
'wagtail_blocks',

Sample Usage

from wagtail.fields import StreamField
from wagtail.admin.panels import FieldPanel

from wagtail_blocks.blocks import (
    HeaderBlock,
    ListBlock,
    ImageTextOverlayBlock,
    CroppedImagesWithTextBlock,
    ListWithImagesBlock,
    ThumbnailGalleryBlock,
    ChartBlock,
    MapBlock,
    ImageSliderBlock,
)

class HomePage(Page):
    body = StreamField([
        ('header', HeaderBlock()),
        ('list', ListBlock()),
        ('image_text_overlay', ImageTextOverlayBlock()),
        ('cropped_images_with_text', CroppedImagesWithTextBlock()),
        ('list_with_images', ListWithImagesBlock()),
        ('thumbnail_gallery', ThumbnailGalleryBlock()),
        ('chart', ChartBlock()),
        ('map', MapBlock()),
        ('image_slider', ImageSliderBlock()),
    ], blank=True, use_json_field=True)

    content_panels = Page.content_panels + [
        FieldPanel("body"),
    ]

For HomePage template, blocks should be rendered with IDs to function properly

{% for block in page.body %}
    {% include_block block with block_id=block.id %}
{% endfor %}

Available Blocks

Check Showcase for Standard Blocks or Charts or Maps

streamfield

Supported Versions