Coder Social home page Coder Social logo

katdom13 / wagtail_blocks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ibrahimawadhamid/wagtail_blocks

0.0 0.0 0.0 7.32 MB

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

Home Page: https://wagtail-blocks.readthedocs.io

License: MIT License

Python 32.07% CSS 19.27% Makefile 1.54% HTML 47.13%

wagtail_blocks's Introduction

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.

Note

This project is still early on in its development lifecycle. It is possible for breaking changes to occur between versions until reaching a stable 1.0, however we will clearly note any breaking changes between releases if applicable. Feedback and pull requests are welcome.

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:

'wagtailfontawesome',
'wagtail_blocks',

Sample Usage

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)

    content_panels = Page.content_panels + [
        StreamFieldPanel("body", classname="Full"),
    ]

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

  • Header (H1, H2, H3, H4, H5, H6)
  • List (Unordered List)
  • Image with Text Overlay
  • Cropped Images with Text
  • List with Images and Links
  • Thumbnail Gallery
  • Image Slider
  • Chart (Bar - Pie - Line - Area - Radar)
  • Map (Marker with rich text description)

Supported Versions

  • Python 3.6 and higher
  • Wagtail 2 and higher
  • Bootstrap 4

wagtail_blocks's People

Contributors

brianxu20 avatar fabienheureux avatar ibrahimawadhamid avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.