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.3.0.tar.gz (13.5 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.3.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wagtail_sb_structblock-0.3.0.tar.gz
  • Upload date:
  • Size: 13.5 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.3.0.tar.gz
Algorithm Hash digest
SHA256 29225cc1114d0c697189926e6255dab71cecbce28e1ae35149a19337009fe150
MD5 21ef97444eec5905d80bdce4b5d5ffc1
BLAKE2b-256 8deeef37ebffdc027bbae64a3b7e2b07334c70bd903be1e17e5c36ede9de2687

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wagtail_sb_structblock-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 15.3 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 951de8cea2518d3f4458a6da08e5aa9bda66940f200447c8acb4fc11fa3485dd
MD5 3835fde00e567c54c3170069f33b1ba9
BLAKE2b-256 48f4bfa432be2076940f2b7c74426ce14cffc40491413fe153b05686e57d29d8

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