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.
Add a way to provide meta tags specifically for 403 and 404 pages.
Comment | File | Size | Author |
---|---|---|---|
#6 | metatag-n2156261-6.patch | 8.42 KB | DamienMcKenna |
Comments
Comment #1
plopescHello
To do this, we can use a workaround with context_error and metatag_context modules for this pages.
However, if you consider it necessary, I could help with this feature request.
Comment #2
plopescAttaching patch that could address this.
By default, it does not cache the results, but we could add the variable you mentioned in #2090557: Don't load/cache data on 403 & 404 error pages to allow cached values.
Regards.
Comment #3
DamienMcKennaNice, I'll review it tomorrow.
Comment #4
plopescCould this feature be included in beta-8?
If you need any change, let me know.
Regards.
Comment #5
DamienMcKennaI'll give it a test run tonight and will post a follow-up.
Comment #6
DamienMcKennaI've changed it around a little bit. I realized that there's no point in not caching the 403/404 page output as the new structure results in only one cache object per 403 or 404 page, not an infinite number; I've also removed the now-unnecessary 'metatag_cache_error_pages' variable that only existed for a few weeks.
Comment #7
DamienMcKennaOh, also the patch in #6 adds several default values for the Open Graph, Dublin Core and Twitter Cards submodules; in each case the values are set to mimic what would be output on the homepage, i.e. if someone shared a 403 or 404 page on a social network they'll only get a link to the site's homepage, not the error page.
Comment #8
plopescNice!
Thank you for your great work. If you need any help, just let me know ;)
Comment #9
HyperGlide CreditAttribution: HyperGlide commented@plopesc -- if wanna help -- then please test the patch ;-)
Comment #10
DamienMcKennaCommitted! Thanks plopesc!