Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello! Looks like the image_src
tag is getting output as a meta tag in 8.1.x, instead of a link tag as it did in D7.
Entering https://www.drupal.org/files/drupal_logo-blue.png
in the "image" config field on admin/config/search/metatag/global results in a meta tag getting output:
<meta name="image_src" content="https://www.drupal.org/files/drupal_logo-blue.png">
Looking around the web, and in the d7 version, I'd expect to see a link tag instead.
<link rel="image_src" href="https://www.drupal.org/files/drupal_logo-blue.png">
All that needs to change to make this happen is the ImageSrc class should extend LinkRelBase instead of MetaNameBase, and a couple tests need updates.
Comment | File | Size | Author |
---|---|---|---|
#6 | image_src_should_be_a-2824442-6.patch | 2.59 KB | jlandfried |
|
Comments
Comment #2
jlandfried CreditAttribution: jlandfried at Last Call Media commentedpatch attached
Comment #3
jlandfried CreditAttribution: jlandfried at Last Call Media commentedActually, started running into some issues while looking into https://www.drupal.org/node/2628472. We lose all of the image
src
extraction functionality that's currently contained inMetaNameBase
when we switch toLinkRelBase
, so this isn't ready yet.Comment #4
jlandfried CreditAttribution: jlandfried at Last Call Media commentedLooks like
ImageSrc
is the only tag that is of typeimage
that should extendLinkRelBase
, so I think this can be handled as a special case. Happy to be corrected if that's not the case, or this isn't the best way to handle this though.Comment #5
DamienMcKennaI think a better approach would be to run parent::output() in LinkRelBase and then adjust the array accordingly.
Comment #6
jlandfried CreditAttribution: jlandfried at Last Call Media commentedSomething more like this?
Comment #7
DamienMcKennaYes, awesome :) I'll review it in the morning.
Comment #8
rbayliss CreditAttribution: rbayliss at Last Call Media commentedMakes sense... I won't RTBC it since Damien's already on it, but it looks good to me!
Comment #9
DamienMcKennaComment #11
DamienMcKennaCommitted. Thanks!