Currently, when an imagefield based token is used for the OG:Image metatag, the resulting metatag is output something like this (sanitized value from client site):
<meta property="og:image" content=" <img src="http://www.example.com/sites/default/files/sys/en/page/image/xxxx-contact-us-teaser-en_0.jpg" width="2048" height="750" alt="Contact Us" title="Contact Us" typeof="foaf:Image" />
I spoke about it with Damien and he said the D7 version has logic to pull out the URL that needs to be ported to D8. I'd be willing to give it a whirl but not sure how soon I'll be able to so I'm leaving this unassigned for now.
Comment | File | Size | Author |
---|---|---|---|
#7 | metatag-n2613654-7.patch | 18.48 KB | DamienMcKenna |
Comments
Comment #2
DamienMcKennaLets add this to beta2.
Comment #3
DamienMcKennaThere are two parts to how this is handled in D7 - a) any meta tag that has the 'image' attribute set to TRUE tells the output generation to b) grep the output for any image tags.
Comment #4
MichelleHere is a patch that fixes the issue similar to D7 but I have a couple concerns:
Comment #5
MichelleAs for the field token mystery, it turns out that Token _is_ installed on the client's site and it just didn't come up in the filter for some reason. So the trick to getting field tokens to work is to have contrib Token installed plus this patch: #2543756: Use renderPlain() in field_tokens() . This works despite the fact that Metatag is using the core token rendering and _not_ the contrib Token version, which I wasn't expecting.
So, to test this patch:
Comment #6
DamienMcKennaComment #7
DamienMcKennaThis adds the two optional strings to the description of meta tags if they have the 'multiple' or 'image' items defined.
Comment #8
DamienMcKennaCommitted.
Comment #10
juampynr CreditAttribution: juampynr at Lullabot commentedI don't understand the need of the "multiple" property. @Michelle, can you explain it, please?
Comment #11
MichelleIt was in D7 and used in the code I ported so I ported it as well. I assume it's needed to provide multiple images to choose from like when you share a gallery on Facebook and you can scroll thru and decide which image to represent.
Comment #12
DamienMcKennaSome of the meta tags allow for multiple tags, some don't, so we have to handle that.
Comment #13
DamienMcKennaAnd yes, we need to build out the functionality for supporting multiple values (I'd forgotten about it).
Comment #14
DamienMcKennaI've added another issue to finish the support for 'multiple' tags: #2628934: Full support for meta tags that allow multiple values
Comment #15
juampynr CreditAttribution: juampynr at Lullabot commentedThanks for the explanation!
Comment #16
DamienMcKenna