Metadata-Version: 2.1
Name: wagtail-tabbed-structblock
Version: 0.0.3
Summary: 
Author: Eric Kersten
Author-email: eric.kersten@egodesign.io
Requires-Python: >=3.10,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Description-Content-Type: text/markdown

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

```python
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.
