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

Created on 22 January 2020, almost 5 years ago
Updated 17 July 2023, over 1 year 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

Needs review

Version

2.0

Component

User interface

Created by

🇺🇸United States dave reid Nebraska USA

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

Merge Requests

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 over 1 year 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 over 1 year ago
    113 pass
  • 🇧🇪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 about 1 year ago
  • 🇫🇮Finland Kirsij

    Changing the status as I have successfully applied this patch.

  • 🇨🇦Canada mrogers

    Anyone have any success re-rolling against 2.1?

  • First commit to issue fork.
  • 🇪🇸Spain vengador

    Re-rolled patch against 2.1.x branch and created MR.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 319s
    #335351
  • First commit to issue fork.
  • 🇭🇺Hungary balagan

    Thanks for the patch. It's working fine with metatag 2.1.0. Just adding my 2 cents that using the small select box is not the best UX.

  • 🇫🇮Finland Aelfendir

    I tested the merge request and it seemed to work perfectly (Metatag 2.1.0, D10.3.9). Thank you for the great feature!

    I agree with balagan that selection of multiple fields with the current widget was not super easy/intuitive. But the ability to select the editable metatags in the first place is a huge improvement. I don't have any better suggestions at the moment.

Production build 0.71.5 2024