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
- Install the package with
pip install wagtail-tabbed-strucblock. - Add to
INSTALLED_ADDaswagtail_tabbed_structblock.
Usage
- Import the class with
from wagtail_tabbed_structblock.blocks import TabbedStructBlock. - Create your
StructBlockas usual extendingTabbedStructBlock. - Define the tabs in the
Metaclass 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wagtail_tabbed_structblock-0.0.7.tar.gz.
File metadata
- Download URL: wagtail_tabbed_structblock-0.0.7.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7027f0caba53c6bf5e2e5c20c7a8a3b20bc7f89dbd3d29e343b6b69629a236b
|
|
| MD5 |
a4d6a69c827a4cc54640d058fbdc70f1
|
|
| BLAKE2b-256 |
f7c7be50a663188577b3633b045fcdf77cd3d980fee1f12b3603ec6532da071b
|
File details
Details for the file wagtail_tabbed_structblock-0.0.7-py3-none-any.whl.
File metadata
- Download URL: wagtail_tabbed_structblock-0.0.7-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d182ac68c01e71989eff3451e18d1bd2928596e1d2204b0d805bb314f9a4a142
|
|
| MD5 |
0748e41fd50b409b0a315744b2820e1e
|
|
| BLAKE2b-256 |
4dc3091470f505f8dd4872d8df3ea340456a43418bd3780d66d9c0ba60444f56
|