Allow which metatags are visible on the field widget to be editable

Created on 22 January 2020, over 4 years ago
Updated 27 November 2023, 7 months ago

Say I only want to expose a couple meta tags as editable to my node forms, but I want all the metatags to still work with defaults. I think adding a setting to the MetatagFieldItem that limits the editable tags would be a good solution. I think this works best on the field setting level, instead of the widget, so that way the settings can be implemented by all possible field widgets (including the firehose widget).

✨ Feature request
Status

RTBC

Version

2.0

Component

User interface

Created by

🇺🇸United States Dave Reid Nebraska 🇺🇸

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.3 & MySQL 5.7
    last update 11 months ago
    Patch Failed to Apply
  • 🇩🇪Germany Atropoides Hamburg

    I rerolled the patch to 2.0.0.
    For now I'm not able to set the branch to 2.0.x and provide a merge request, hope someone else can do it.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update 11 months ago
    113 pass
  • 🇩🇪Germany Atropoides Hamburg
  • 🇧🇪Belgium bramvandenbulcke

    This would be a welcome addition to the Metatags module! The forms are too long now and contain obsolete information:

    • The Basic tags contain two fields that are no longer supported. This information clutters the interface.
    • The Open Graph tags form is really long.

    I mostly try to avoid printing the form for website editors (mostly by using a summary field) but sometimes they want a custom metatag description.

    I'm currently hiding the unused metatags in Seven with some CSS (I use a small custom module to override the admin styling):

    #edit-field-metatags-0-basic .form-item,
    #edit-field-metatags-0-open-graph .form-item {
    	display: none;
    }
    
    #edit-field-metatags-0-basic .form-item.form-item-field-metatags-0-basic-title,
    #edit-field-metatags-0-basic .form-item.form-item-field-metatags-0-basic-description,
    #edit-field-metatags-0-open-graph .form-item.form-item-field-metatags-0-open-graph-og-title,
    #edit-field-metatags-0-open-graph .form-item.form-item-field-metatags-0-open-graph-og-description {
    	display: block;
    }
    

    This will expose only the meta title and description on the basic and Open Graph fields. It's a dirty solutions but it helps to clean up the interface.

  • Status changed to RTBC 7 months ago
  • 🇫🇮Finland Kirsij

    Changing the status as I have successfully applied this patch.

Production build 0.69.0 2024