Indicate publication status on the taxonomy overview page

Created on 27 October 2023, over 1 year ago
Updated 6 March 2024, about 1 year ago

Problem/Motivation

It is not possible to tell whether terms are unpublished when looking at the taxonomy overview page.

Proposed resolution

Add an indication on the VocabularyOverview page.

Remaining tasks

Work out how to show publication status on the taxonomy overview page.
Add test coverage.

User interface changes

The taxonomy overview page indicates whether each term is published.

API changes

TBD

Data model changes

TBD

Release notes snippet

TBD

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component
TaxonomyΒ  β†’

Last updated about 8 hours ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @xjm
  • πŸ‡¬πŸ‡§United Kingdom @catch
Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

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

Comments & Activities

  • Issue created by @DamienMcKenna
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    As a workaround, here's what I added to a custom module:

    /**
     * Implements hook_form_FORM_ID_alter() for taxonomy_overview_terms.
     */
    function MYMODULE_form_taxonomy_overview_terms_alter(&$form, FormStateInterface &$form_state, $form_id) {
      foreach ($form['terms'] as $key => &$value) {
        if (is_array($value) && isset($value['term']) && is_array($value['term'])) {
          if (!empty($value['term']['tid']['#value'])) {
            $term = Term::load($value['term']['tid']['#value']);
            if (empty($term->status->value)) {
              $value['#attributes']['class'][] = 'term--unpublished';
            }
          }
        }
      }
    
      $form['terms']['#attached']['library'][] = 'MYMODULE/admin_tweaks';
    }
    

    MYMODULE.libraries.yml has this:

    admin_tweaks:
      css:
        component:
          css/admin-tweaks.css: { }
    

    css/admin-tweaks.css has this:

    .term--unpublished {
      background-color: #fff4f4;
    }
    

    Hope this helps someone else.

  • Status changed to Closed: outdated over 1 year ago
  • πŸ‡«πŸ‡·France vbouchet

    I am closing as it seems a duplicate of #3359159 ✨ Add Status to OverviewTerms.php form Fixed which was solved some time back.

  • Status changed to Active over 1 year ago
  • πŸ‡«πŸ‡·France vbouchet

    Actually reading at the exact title and the workaround, it seems more a visual indication which is requested here.

    If we decide to so, it should be consistent with other places we list entities with "Status" column.

  • First commit to issue fork.
Production build 0.71.5 2024