clickstorm / cs_seo

[clickstorm] SEO
Other
33 stars 49 forks source link

Overwriting the body-tag is very radical #319

Closed heural closed 11 months ago

heural commented 1 year ago

Please do not overwrite the body-tag, extensions and typo3 itself add attributes/classes to this tag.

https://github.com/clickstorm/cs_seo/blob/28141a6f8cce3385064b9a87dd3a72baf2d83f6b/Configuration/TypoScript/Additional/Tracking/GoogleTagManager/setup.typoscript#L5

Instead to overwrite whole body-Tag, wrap it around: `page.bodyTagCObject.stdWrap.append = COA page.bodyTagCObject.stdWrap.append { 654 = COA 654 { 10 = TEXT 10 { value = {$plugin.tx_csseo.tracking.googleTagManager} wrap (

        <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=|" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
        <!-- End Google Tag Manager (noscript) -->
        )
        required = 1
    }
}

}`

mhirdes commented 11 months ago

Therefore it is an extra TypoScript. If you don't like to use it, just skip it.

heural commented 11 months ago

You want to add the tag "iframe" next to the body tag and instead of wrapping you overwrite the whole body tag with "<body>" and discard the configuration of page.bodyTagCObject so far. It is not a question to use or not to use the additional typoscript. We have spent time to locate the bug. After the install of your extension, the body tag losses all attributes, class, id etc.