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

Uploaded Python 3

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

Hashes for wagtail_sb_structblock-0.4.0.tar.gz
Algorithm Hash digest
SHA256 2fc0f0991fbe2f3aa4635bce956140088d7f541119a49067c047572efadef893
MD5 a459c4cd2213bf1b758639c5153fbee0
BLAKE2b-256 11d9d83a0dba6e3b28dd7e6d307c3dbad068e51e749143d7a92e20336a609cbd

See more details on using hashes here.

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

Hashes for wagtail_sb_structblock-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7d369df9e299a42c4eec084ee131381fc934239d69f965479654c075263fd2a
MD5 22f5b5cfd794fa80a20e24e42158df5c
BLAKE2b-256 b104ffa43decf475cd006d39ec81eec23e52ecae2b43eaf9d3ad134eb73482e4

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