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.
I've created a (currently sandbox) module to add some URL processing functions to Metatag: Metatag URLs.
There are 2 tasks that I'm hoping the Metatag pros can help me with:
- Sanity check: I tried reading all of the Metatag docs, and looking at the code, and to my eyes the features of my module are not redundant, but could actually be useful (I needed them for my use case, anyway). Did I miss something obvious?
- If the module is sane, I'd be happy to make it a full project. Could it be listed on the Metatag project page?
Thanks in advance!
Comments
Comment #2
DamienMcKennaIs there any reason that you couldn't use [site:url] in front of the image paths?
Comment #3
jay.dansand CreditAttribution: jay.dansand as a volunteer commentedThat's a really good question! I wasn't sure, so I checked:
[site:url]foo.bar
is an absolute URL with the requested scheme (which may cause problems depending on caching reverse proxy setups), andurlFromUri(base:foo.bar)
is root-relative.If requesting over http (not https):
The difference probably doesn't matter to many, but may matter to some (I have no idea how many; maybe just me).
Comment #4
DamienMcKennaI don't see a way of getting the relative path using tokens, so I opened a feature request issue for it: #2923851: Additional sub tokens for [site:url] token
Comment #5
DamienMcKennaThis is a cool idea, though. There's definitely some overlap with #2761909: og:image does not parse url from image field properly when there is a comma in the alt field.
Comment #6
jay.dansand CreditAttribution: jay.dansand as a volunteer commentedThanks for looking into it! I'm relieved that it wasn't an obvious "why not just X?" I was missing.
I'll let this issue linger for a while; if it ultimately seems useful, I'll make it a full project. Might as well let others benefit.