Overriding the meta tags

Created on 27 February 2023, over 1 year ago
Updated 13 July 2023, 12 months ago

It would be great to add another submodule to work with meta tags. It could be used to override the meta tags of views pages with exposed filters or the results of faceted filters etc.

✨ Feature request
Status

Fixed

Version

1.2

Component

Code

Created by

πŸ‡·πŸ‡ΊRussia a.sinitsa

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Issue created by @a.sinitsa
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    @a.sinitsa which "meta tags" do you want to overwrite? Those from the Metatag β†’ module? If so, we would have to either ask the metatag maintainers, if they wanted to integrate with ECA or we would have to start a new module eca_metatag because ECA itself won't get anything included that introduces new dependencies.

    And I'm not sure what you mean by overwriting "the results of faceted filters". How is that related to meta tags?

  • πŸ‡·πŸ‡ΊRussia a.sinitsa

    I want to override title, description and maybe canonical. We have many clients who have product catalogs built on search api with faceted filtering. For SEO optimization work, we often need to override meta tags for a combination of faceted filters. This is not very convenient to do right now. But if ECA could redefine meta tags, it would be much easier.

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    I understand. When we want to overwrite something, we need to know where that data comes from. Hence the question, if you're talking about meta tags from the metatag module or if you have anything else that creates those meta tags for you?

  • πŸ‡·πŸ‡ΊRussia a.sinitsa

    Of course, the main tool for defining meta tags in the catalog is the metatag module. It overwrite meta tags for a taxonomy term, as for a catalog section. And what is needed next is to override the meta tags for the taxonomy term if any facets are active.

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    WRT all your conditions (facets, terms, filters, etc.) you should be able to receive them from the URL. So, existing conditions in ECA should already do that part of the job.

    As for overriding metatags of a view, I've just looked into the metatag_view module and they override the metatags themselves by implementing hook_metatags_alter(). That hook then reads the view config and overrides the default metatags. With that in mind, one could overwrite the view config dynamically by using the Config: write action. I've just tested that and I'm able to e.g. set the title of the page or the summary tag.

    If that's not sufficient, someone would have to write a separate module eca_metatag to get there, as described above.

  • Status changed to Fixed 12 months ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Closing due to missing feedback.

    Also, note that there is now the ECA Metatag β†’ integration module available.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024