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.7.tar.gz (19.1 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.7-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for wagtail_tabbed_structblock-0.0.7.tar.gz
Algorithm Hash digest
SHA256 a7027f0caba53c6bf5e2e5c20c7a8a3b20bc7f89dbd3d29e343b6b69629a236b
MD5 a4d6a69c827a4cc54640d058fbdc70f1
BLAKE2b-256 f7c7be50a663188577b3633b045fcdf77cd3d980fee1f12b3603ec6532da071b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wagtail_tabbed_structblock-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d182ac68c01e71989eff3451e18d1bd2928596e1d2204b0d805bb314f9a4a142
MD5 0748e41fd50b409b0a315744b2820e1e
BLAKE2b-256 4dc3091470f505f8dd4872d8df3ea340456a43418bd3780d66d9c0ba60444f56

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