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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for wagtail_tabbed_structblock-0.0.5.tar.gz
Algorithm Hash digest
SHA256 96b060c12b48a2a531b2ed8e9bfddec73e5324f5c32d21d7c2c6d8651c07c5ac
MD5 d0ceabbef6e0092cea7384b6780a7d64
BLAKE2b-256 1ea26276d826ddfead7fb9f5695192b4be66a829d799ab23dc782a159644141e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wagtail_tabbed_structblock-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 943a93f151fdd55792046e9f73db505e369f9d528d51d30fe7cf3161c0019038
MD5 a1407efb12a91ee515dee769876c0e74
BLAKE2b-256 59dc72b617292eaad7389c90b0a811df4df219d2e8128009d0d274d5d0f3c4f0

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