Add tags to media items

Created on 19 January 2024, 10 months ago
Updated 21 March 2024, 8 months ago

User Story


As a content author
I want to be able to tag media items (documents, images etc)
So that I could easily search for items by tags

Description


Several projects has shown that they are using media tags - a dedicated vocabulary for media items. This allows the content authors to perform more efficient media management, including searching within a media library.

Acceptance Criteria


AC1 - Media tags vocabulary
GIVEN I’m a Content author
WHEN I navigate to Media tags vocabulary (civictheme_media_tags)
THEN I can create/edit/delete tags

AC2 - Tagging media items with Media tags
GIVEN I’m a Content author
WHEN I create any of the media items
THEN I can specify one or more media tags
AND I can create new media tags (in the same UI)

AC3 - Searching through Media Library using Media tags
GIVEN I’m a Content author
WHEN I go to Content → Media page
AND I specify one or more media tags parts (comma delimited) in the search filter
THEN I can filter media items by the specified media tags

Solution Direction


  1. Create Media tags (civictheme_media_tags) vocabulary

  2. Add permissions for the Content author and Site administrator roles to perform CRUD operations on terms (but not the vocabulary).

  3. Add Behat tests for permissions

  4. Add entity reference Media tags ( field_m_media_tags ) field to each media entity:

    1. Set it to allow creating new tags.

    2. Use autocomplete widget

  5. Update existing Behat tests for fields on media entities

  6. Create a clone of vanilla Drupal Media view and store it as optional config in theme (leave the name as-is). Adjust filters to show the `Media tags` filter and allow to match on partial tag matches.

  7. Implement an additional settings provisioning option to replace Media view with the one shipped in CT configuration.

  8. Add a Behat test that would be checking that a Content->Media page has the required filters and can be searched through.

  9. Create a clone of vanilla Drupal Media library view and store it as optional config in theme (leave the name as-is). Adjust filters to show the `Media tags` filter and allow to match on partial tag matches.

  10. Implement an additional settings provisioning option to replace Media library using the one shipped with configuration.

  11. Add a Behat test that would be checking that a media library has the required filters and can be searched through.

Testing Notes


None
Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

🇦🇺Australia alex.skrypnyk Melbourne

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024