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.6.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.6-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for wagtail_tabbed_structblock-0.0.6.tar.gz
Algorithm Hash digest
SHA256 066cac5587c2ad0df7f8773bf78ec49ffc17ba53e2b870410c1ce3e86b98f13c
MD5 3ac510428b76d09f4590fe96a2eb9b35
BLAKE2b-256 58d624b3076393aebbde97e9a90d7ece72b9feafa3aa1526ec99d5324463f2af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wagtail_tabbed_structblock-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5b4a55b74e256c29a1eeebe1659de3261bcb10e2ef404a106b4ed942a13a6e10
MD5 567ff26c39e2ec6174293fbe5313c9b0
BLAKE2b-256 0c82f43812ff82d003a71cb3e294889d3479fc42ebc0222c9afd5cfd8dc58c95

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