Skip to content
This repository was archived by the owner on Aug 8, 2022. It is now read-only.
This repository was archived by the owner on Aug 8, 2022. It is now read-only.

Make use of GLOBALS['TSFE']->getPageRenderer()->addMetaTag() #136

Open
@thomaszbz

Description

@thomaszbz

Reported by @georg-tiefenbrunn via https://forge.typo3.org/issues/62154 :

I stumbled upon this because I got multiple description tags using EXT:news which adds meta tags using its MetaTagViewHelper which uses $GLOBALS['TSFE']->getPageRenderer()->addMetaTag(). Tags are built using Fluid's TagBuilder, which always adds ' />' to empty tags.

Thus EXT:news adds following meta tags:

<meta name="description" content="example description" />
<meta property="og:description" content="example description" />

EXT:metaseo later adds its own meta tags:

<meta name="description" content="example description">
<meta name="DC.Description" content="example description">

One quick solution is to change the fluid templates of EXT:news and disable the meta tag generation.

A much better solution would be to use $GLOBALS['TSFE']->getPageRenderer()->addMetaTag() (and addHeaderData) in EXT:metaseo to add the header data to prevent duplicate tags with same content.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions