- 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 1:31pm 15 January 2024 - π«π·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 1:32pm 15 January 2024 - π«π·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.