Skip to main content

No project description provided

Project description

Tabbed StrucBlock

A new UI for StrucBlocks

As custom blocks grow in fields it becomes necessary to group and hide some of the block fields. Tabbed StrucBlock allows such grouping into a tabbed UI.

Installation

  1. Install the package with pip install wagtail-tabbed-strucblock.
  2. Add to INSTALLED_ADD as wagtail_tabbed_structblock.

Usage

  1. Import the class with from wagtail_tabbed_structblock.blocks import TabbedStructBlock.
  2. Create your StructBlock as usual extending TabbedStructBlock.
  3. Define the tabs in the Meta class of the block as shown in the example below.
from wagtail import blocks

from wagtail_tabbed_structblock.blocks import TabbedStructBlock


class ExampleBlock(TabbedStructBlock):
    title = blocks.CharBlock()
    content = blocks.RichTextBlock()


    class Meta:
        tabs = {
            'Header': ('title',),
            'Body': ('content',)
        }

The tabs property of the Meta class is a dictionary composed of the title of the tab and a tuple of the fields you want to include on that tab.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wagtail_tabbed_structblock-0.0.8.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wagtail_tabbed_structblock-0.0.8-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file wagtail_tabbed_structblock-0.0.8.tar.gz.

File metadata

File hashes

Hashes for wagtail_tabbed_structblock-0.0.8.tar.gz
Algorithm Hash digest
SHA256 495a399042e8765888ca0a3064c0298345d23036e0533fb9abedda73f8d6d60e
MD5 018d24d652c789ebb0573718a8333306
BLAKE2b-256 153244730364c2d542caf4577c0d94af3def816010bb3a46ecb4ebc0866dc027

See more details on using hashes here.

File details

Details for the file wagtail_tabbed_structblock-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for wagtail_tabbed_structblock-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 133e89a49116d93d71194b24e13542b8c0f652fab8d180a0763ecd4f8be7d08f
MD5 3eefe4142aef07560940f5b7a744fd71
BLAKE2b-256 c055eb266160282030155195c0fd750fad5794dc7da432d0e0645a0547dc6595

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page