Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC 28: Tagging improvements #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

kaedroho
Copy link
Contributor

@kaedroho kaedroho commented Jun 1, 2018

@kaedroho kaedroho changed the title RFC: Tagging improvements RFC 28: Tagging improvements Jun 1, 2018
@kaedroho
Copy link
Contributor Author

kaedroho commented Jun 4, 2018

cc @wagtail/ux-design

@jonnyscholes
Copy link

FWIW the functionality outlined in Add a “Tag management” interface would be absolutely fantastic. We've had recurring issues with this too (especially when user accidentally add sentenced cased and lower cased variants of the same tag).

@gasman
Copy link
Contributor

gasman commented Jun 6, 2018

Rather than adding a new input field for filtering by tags, one option would be to support a syntax for that within the main search box, e.g. croissant tagged:Savoury. The downside is that it's not as discoverable as an explicit field, and it'd be harder to integrate autocomplete.

As a minor point on the layout, bear in mind that the Collections dropdown won't always be there (it's hidden when no collections exist, or the user only has permission for one) so the UI would have to adjust to deal with the presence or absence of that field.

How useful is the 'popular tags' listing anyway? I don't think users would miss it too much if we dropped it, if we're giving them a better tag filtering UI at the same time. Perhaps we can set up the 'tags' field to offer the 'popular' list as an autocompletion dropdown when you first focus on the field?

@kaedroho
Copy link
Contributor Author

kaedroho commented Jun 6, 2018

Rather than adding a new input field for filtering by tags, one option would be to support a syntax for that within the main search box, e.g. croissant tagged:Savoury. The downside is that it's not as discoverable as an explicit field, and it'd be harder to integrate autocomplete.

Maybe we could use this as a way to display the currently selected tags. To make it clear how to add a tag, we could add a small tag icon to the right of the search box which displays a tag selector?

How useful is the 'popular tags' listing anyway? I don't think users would miss it too much if we dropped it, if we're giving them a better tag filtering UI at the same time. Perhaps we can set up the 'tags' field to offer the 'popular' list as an autocompletion dropdown when you first focus on the field?

👍


Add a separate interface in Wagtail to allow admins/moderators to manage the available tags. This would allow defining tags before inserting content and renaming tags for consistency. This could also include merging duplicate tags as well.

This could be used in conjunction with free tagging or free tagging could be disabled entirely.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making use of the permission system would probably work well here: users get free tagging if they have 'add' permission over the tag model, and access to the tag management interface if they have edit/delete permission.

@gasman
Copy link
Contributor

gasman commented Jan 31, 2020

Proposed approach for disabling free tag creation (i.e. only allowing existing tags to be selected, through autocomplete):

  • Patch tag-it.js with Added autocompleteOnly option aehlke/tag-it#322
  • Add a flag to AdminTagWidget to pass autocompleteOnly in initTagField - this would be sufficient to disable creation of new tags by setting FieldPanel('tags', widget=AdminTagWidget(free_tagging=False)), but this would only be enforced client-side
  • Introduce a subclass of taggit.forms.TagField (I propose locating this at wagtail.admin.forms.tags) that accepts the free_tagging argument, and - as well as passing it on to AdminTagWidget - validates server-side that all entered tags are ones that exist already. This would allow devs to fully disable tag creation, but requires a custom admin form (https://docs.wagtail.io/en/v2.7.1/advanced_topics/customisation/page_editing_interface.html#wagtail.admin.forms.WagtailAdminPageForm)
  • Add a TagFieldPanel edit handler that accepts a free_tagging=False argument and passes it on to the form field; this allows tag creation to be disabled without needing a custom form.
  • Update documentation to cover the new parameter / panel type

@rgs258
Copy link

rgs258 commented Mar 26, 2020

@gasman Hey Matt, We're interested in this enhancement for a project we're working on. I wonder if this is a candidate for a release soon?

@gasman
Copy link
Contributor

gasman commented Mar 26, 2020

@rgs258 Yep - this is now implemented and will be part of Wagtail 2.9, due for release at the beginning of May: https://docs.wagtail.io/en/latest/reference/pages/model_recipes.html#disabling-free-tagging

@rgs258
Copy link

rgs258 commented Mar 26, 2020

@rgs258 Yep - this is now implemented and will be part of Wagtail 2.9, due for release at the beginning of May: https://docs.wagtail.io/en/latest/reference/pages/model_recipes.html#disabling-free-tagging

You're so fast! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants