Tabbed interface for Wagtail's struct blocks with settings fields.
Project description
Wagtail SB Struct Block
Tabbed interface for Wagtail's struct blocks with settings fields.
Package to render Wagtail StructBlock with a tabbed interface to distinguish
between content fields and settings fields, improving the editor experience.
✨ Features
- Tabbed Interface: Cleanly separate content fields from settings fields.
- Easy Configuration: Simple to use by subclassing and defining
settings_fieldsinMeta. - Modern Stack: Built for modern Python (3.11+) and up to date Django/Wagtail versions.
📋 Requirements
- Python 3.11 or higher
- Wagtail 5.2 or higher
- Django 4.2 or higher
📦 Installation
Using pip
pip install wagtail-sb-structblock
Using uv
uv add wagtail-sb-structblock
🚀 Usage
Add wagtail_sb_structblock to your INSTALLED_APPS settings:
INSTALLED_APPS = [
# ...
"wagtail_sb_structblock",
# ...
]
In your struct blocks must inherit from
wagtail_sb_structblock.blocks.StructBlock and you must specify the
settings_fields in your Meta class.
from wagtail.blocks import CharBlock
from wagtail_sb_structblock.blocks import StructBlock
class EnhancedHTMLBlock(StructBlock):
text = CharBlock()
html_attrs = CharBlock()
class Meta:
settings_fields = [
"html_attrs",
]
Include it in your stream field and your model so you can use a tabbed interface for your struct block.
🛠️ Development
Check out our Contribution Guide for details on setting up your development environment, running tests, and submitting pull requests.
The project uses uv for dependency management, ruff for linting, and tox
for multi-environment testing.
📜 Changelog
See the CHANGELOG.md for a history of changes.
👥 Contributors
See our list of contributors.
📄 License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
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_sb_structblock-0.4.0.tar.gz.
File metadata
- Download URL: wagtail_sb_structblock-0.4.0.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fc0f0991fbe2f3aa4635bce956140088d7f541119a49067c047572efadef893
|
|
| MD5 |
a459c4cd2213bf1b758639c5153fbee0
|
|
| BLAKE2b-256 |
11d9d83a0dba6e3b28dd7e6d307c3dbad068e51e749143d7a92e20336a609cbd
|
File details
Details for the file wagtail_sb_structblock-0.4.0-py3-none-any.whl.
File metadata
- Download URL: wagtail_sb_structblock-0.4.0-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7d369df9e299a42c4eec084ee131381fc934239d69f965479654c075263fd2a
|
|
| MD5 |
22f5b5cfd794fa80a20e24e42158df5c
|
|
| BLAKE2b-256 |
b104ffa43decf475cd006d39ec81eec23e52ecae2b43eaf9d3ad134eb73482e4
|