webdevops / TYPO3-metaseo

TYPO3 MetaSEO Extension
https://typo3.org/extensions/repository/view/metaseo
GNU General Public License v3.0
38 stars 24 forks source link

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

Open thomaszbz opened 9 years ago

thomaszbz commented 9 years ago

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.

thomaszbz commented 9 years ago

39 with 1c00ab5652b2ae64e10767a84aa124ef07e0801f perfectly prepares this refactoring step. Just that I'd like to see