Skip to main content

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.

Community-Project

PyPI - Supported versions PyPI - Package version PyPI - Downloads PyPI - License Codacy Grade Badge Codacy Coverage Badge Gitlab Pipeline Status

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_fields in Meta.
  • 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.

content tab

settings tab

🛠️ 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

wagtail_sb_structblock-0.5.0.tar.gz (14.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_sb_structblock-0.5.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file wagtail_sb_structblock-0.5.0.tar.gz.

File metadata

  • Download URL: wagtail_sb_structblock-0.5.0.tar.gz
  • Upload date:
  • Size: 14.2 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

Hashes for wagtail_sb_structblock-0.5.0.tar.gz
Algorithm Hash digest
SHA256 018a8224e81800f2c3d30856bfbb076b1ee7f5f89d64acc63e3fca614b58e3b5
MD5 cc7f69dc7d945568e3f3a73bcf3608a3
BLAKE2b-256 301739aef6cd2827bd8db03ae93b0e270eb44f498db073298b42e5554a094211

See more details on using hashes here.

File details

Details for the file wagtail_sb_structblock-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: wagtail_sb_structblock-0.5.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

Hashes for wagtail_sb_structblock-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59140c765a5df8e77999e3a77242c7815fa1c0699562bfbd261b53b0fae61478
MD5 f4922d1a31c8d3d6d8f6deca712dfe84
BLAKE2b-256 9c126f73fef302bc8c88ff609e37b13e770807bad9c4711636c22dd0ded11819

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