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 tabbed_structblock.

Usage

  1. Import the class with from 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 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.3.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.3-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for wagtail_tabbed_structblock-0.0.3.tar.gz
Algorithm Hash digest
SHA256 30cd642ea670a80198096f6da6ef1565423520a4bb3eeffa771ef389197be842
MD5 6dd927380c0b0cecec3d43ce9c9fae0a
BLAKE2b-256 24c86a9a6c92f9a01f5442f4f6b202e7d09dace27c00656a7d7782fb431f6281

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wagtail_tabbed_structblock-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 faddf6d490858c9c643cee48068628c6d429b890bb48fcbda2bf28c7d1bc66a1
MD5 19edde24f0d650414009e38d389fd4e8
BLAKE2b-256 7e9e18b035788fb42fd4ea79ebdef13de5a037954fa5aaceb46d8f4a0a9f0cf5

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