- Issue created by @Anybody
- πΊπΈUnited States DamienMcKenna NH, USA
This is an interesting idea. I haven't ran into the use case for it myself, but that's not to say it isn't valid.
A few questions on the implementation:
- UX - how do you accurately distinguish from the title and the page title in a way that doesn't confuse content admins?
- How much customization would be needed to avoid the page_title plugin from rendering as a meta tag?
- Would any API changes be needed to extract the page_title value for use in the page-title.html.twig?
- π©πͺGermany Anybody Porta Westfalica
Thanks for the rapid feedback @DamienMcKenna!!
We'll elaborate on this and potentially make a first implementation, I guess in a sandbox module, but let's see! I think we can then give better answers on the points rased!
Thank you!!
- πΊπΈUnited States thejimbirch Cape Cod, Massachusetts
I don't see how this is metatag module related as you said, it is not meta data related, will not print in the head.
I have however done similar things. A second field field_h1 and a minor if statement in twig templates would do the trick.
I think the challenge would be to have a content admin look to the metatag field in that admin UI for this. I would think this field should be right next to the title/label field.
- π©πͺGermany Anybody Porta Westfalica
Thanks for the feedback @thejimbirch. I partially agree, but on the other hand I think this is mainly a SEO / Site builder issue, nothing for regular editors in most cases. And as such you'd typically look into the Metatags or learn to do so.
Of course this isn't perfect, but compared to other solutions, I think it's better.
We should place this "Page title" override in its own fieldset within the Metatags area, definitely.Some more notes:
- I've also done custom field implementations to solve this, but I'd like to provide a general solution for this recurring requirement
- I still think it's very close to the Metatag functionality and area
- I'm still open to solve it differently, inspired by metatags
- I think the discussion shows that it propably shouldn't be part of metatag, but be solved in contrib
- π©πͺGermany Grevil
I think that a submodule could be a valid option to resolve this issue!
If Damien doesn't like it, we can always port it as a contrib module!
- Status changed to Postponed
4 months ago 11:56am 7 August 2024 - π©πͺGermany Grevil
Alright, we discussed this internally and since there is currently no proper way to override the raw page heading (h1) before it gets rendered through twig and the fact, that we abuse the metatag system (Manually dettaching the "page_heading" meta tag so it won't be rendered as a real meta tag), this shouldn't be implemented as an official metatag submodule, but rather as a seperate "dirty quickfix" contrib module.
Once π Implement a central point to override the raw page heading (h1) (e.g. hook_page_heading_alter()) Active is fixed, we could rethink implementing this as an official submodule, but until then, we should set this POSTPONED.
- π©πͺGermany Grevil
Here is the contrib module, if anyone is interested: https://www.drupal.org/project/metatag_page_heading β .
- π©πͺGermany Anybody Porta Westfalica
GREAT work @Grevil! That's super useful, I could have used it many many times already, thank you! :) πππ
Maybe others are also interested to give it a try?
So let's keep this postponed until one day @DamienMcKenna wants it in Metatag (or not) ;)