Skip to main content

A Wagtail add-on for managing tags

Project description

Wagtail Tag Manager

PyPI Python License Code style: ruff

Wagtail Tag Manager is an admin interface for managing tag usage across your Wagtail site:

  • View and manage all objects (Page, Image, Document, etc.) using a given tag
  • Works across Pages, Documents, Images, and other tagged models that use django-taggit
  • Add or remove tags from multiple object types
  • Bulk merge and delete tags
  • Add multiple pages to a given tag
  • Edit tag names and slugs
  • Compatible with custom tag models and page models

Supported versions

  • Python 3.8, 3.9, 3.10, 3.11, 3.12, 3.13
  • Django 4.2, 5.0, 5.1, 5.2
  • Wagtail 5.2, 6.1, 6.2, 6.3, 6.4

While these are the officially supported versions, wagtail-tagmanager may work on older versions of Python, Django, or Wagtail as it avoids reliance on newer features. Please note that issues on unsupported versions might not be prioritized.

Installation

  1. Install via pip:

    pip install wagtail-tags
    
  2. Add to your INSTALLED_APPS:

    INSTALLED_APPS = [
        ...
        "wagtail_tagmanager",
    ]
    
  3. Configure your settings:

    1. Specify the model you use that inherits from TaggedItemBase. If you use tags for pages, you would have set this up already. More information here. You must define this setting to use this tag manager :

        WAGTAIL_TAGMANAGER_PAGE_TAG_MODEL = "yourapp.BlogPageTag"
      
    2. If you want to be able add pages to a specific tag in bulk, specify the page model you want to add tags to. If you want to add tags to all pages, set it to your first concrete model that inherits Page (if the model is abstract, this will not work). You must define this setting to add pages to a tag

      WAGTAIL_TAGMANAGER_BASE_PAGE_MODEL = "yourapp.BlogPage"
      

Usage

Once installed, go to the "Tags" section in the Wagtail admin.

There are four main views:

Tag Index View

  • View all tags in the project and how many objects are tagged with each tag
  • Add and Delete tags
  • Merge multiple tags into one
  • Click each tag to go to Tag Edit View

Tags Index View

Tag Edit View

  • Edit tag Name and Slug
  • Button to view all objects tagged with that tag

Tag Edit View

Manage Tags View

  • View and search all objects tagged with the selected tag
  • Remove the tag from multiple objects
  • Button to add pages to this tag (Note: This button only appears if WAGTAIL_TAGMANAGER_BASE_PAGE_MODEL is defined)

Manage Tags View

Add Pages to Tag View

  • Add pages in bulk to the specified tag
  • Search for a specific page by title

Add Pages to Tag View

Known Issues

  • The object count for each tag will count objects even if their model was deleted (since deleting a model does not delete it's corresponding ContentType). This can lead to incorrect object counts on the Tag Index Page. This model is defined in the ContentType model

Contributing

If you would like to contribute, feel free to create a pull request. All changes to main must go through a pull request and be reviewed. Direct pushes, merges without review, or force pushes are blocked by branch protection rules.

Install

Clone this repository:

git clone https://github.com/mikhail-robinson/wagtail-tagmanager.git
cd wagtail-tagmanager

From inside your preferred virtual environment:

cd wagtail-tagmanager
pip install -r requirements.txt

pre-commit

Note that this project uses pre-commit to enforce ruff formatting. This will check that you have run ruff format and ruff check before committing. If you forget, pre-commit will throw the error Git: [WARNING] Unstaged files detected when committing to remind you. To setup locally:

cd wagtail-tagmanager
pre-commit install

Tests

cd wagtail-tagmanager
python3 runtests.py

Please make sure all tests pass before committing

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_tags-1.0.1.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wagtail_tags-1.0.1-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file wagtail_tags-1.0.1.tar.gz.

File metadata

  • Download URL: wagtail_tags-1.0.1.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for wagtail_tags-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5b4c01bba7ecf1440c732ee7e29aa0df22e99b04fc54ec09ad7df934163f3b89
MD5 0e9c5d3b74efed7607b690f152c9e668
BLAKE2b-256 ebf6cd0c96c103a119d76467a04a34969eb2012e4ae7ec8538f13dea2400069a

See more details on using hashes here.

File details

Details for the file wagtail_tags-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: wagtail_tags-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for wagtail_tags-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e1ea84bbffb771e7f3fc91a8b3a3ef194f2aca3efd29aad59fded092df24e578
MD5 44146b2bd16a49f10bd571fabcfd7214
BLAKE2b-256 4afbb950b77f53e021585e347edf7c6e54f618fbcf66dfdb91126bdff50e7e7e

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