Skip to main content

Make help text editable in the Wagtail admin

Project description

Wagtail Editable Help

Make help text editable in the Wagtail admin

License

PyPI version Editable Help CI

Links

Supported versions

  • Python 3.8 - 3.12
  • Django 3.2 - 4.2
  • Wagtail 4.1 - 5.2

Installation

  • Run pip install wagtail-editable-help
  • Add "wagtail_editable_help" to INSTALLED_APPS
  • For Wagtail 5.1 and below: add "wagtail.contrib.modeladmin" to INSTALLED_APPS if not already present
  • Run ./manage.py migrate
  • Optional: add "wagtail_editable_help.middleware.EditableHelpMiddleware" to the MIDDLEWARE setting, somewhere below "django.contrib.auth.middleware.AuthenticationMiddleware". Enabling this middleware will add an "Edit" link at the point the help text is shown, to allow superusers and other users with the appropriate permission to edit the help text.

Usage

For any help_text argument that you wish to make editable:

from wagtail_editable_help.models import HelpText

then replace help_text="Some help text" with help_text=HelpText("model", "identifier", default="Some help text"). The model and identifier strings serve as a unique identifer for the help text string and to organise the strings in the admin interface - they do not need to exactly match the model or field name. HelpText is valid within any definition that supports help text strings, not just model fields - such as form fields and StreamField blocks.

For example:

class HomePage(Page):
    tagline = models.CharField(max_length=255, help_text="Write something snappy here")

could be rewritten to:

from wagtail_editable_help.models import HelpText

class HomePage(Page):
    tagline = models.CharField(max_length=255, help_text=HelpText("Home page", "tagline", default="Write something snappy here"))

The help text string will then be made available for editing within the Wagtail admin under Settings -> Help text, under the heading "Home page tagline".

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_editable_help-0.2.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

wagtail_editable_help-0.2.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file wagtail_editable_help-0.2.0.tar.gz.

File metadata

  • Download URL: wagtail_editable_help-0.2.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for wagtail_editable_help-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b43c55fa02e906a1cae1d79e0bd5595d390b717c5916b7c6e90443c79e93f844
MD5 38335cda2172e75891c5a4e5fd741808
BLAKE2b-256 4843cdc8a3dac90c5b047e469d578112f8e683a85abcbe37630c591c93df2494

See more details on using hashes here.

File details

Details for the file wagtail_editable_help-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for wagtail_editable_help-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b829bf8fe60f1791d133986c6c2ab752f6419b7cd2184af19a8df7ee23fc6d8
MD5 bce56b1746858244a8b0e5a8b8826873
BLAKE2b-256 b05942adfa47c8ee0a26dfd8e9b57f020755509ff31c9a50cbb3b61d5060f34e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page