[FEATURE] Allow to override htmlTag attributes 76/58976/3
authorBenni Mack <benni@typo3.org>
Thu, 29 Nov 2018 06:47:13 +0000 (07:47 +0100)
committerBenni Mack <benni@typo3.org>
Mon, 3 Dec 2018 19:47:30 +0000 (20:47 +0100)
commit8a811b6e3fcb76256888cb83409cf56a4a0b7191
tree36118db33efd389b1759ac4f4561eb1a1e0d9e4c
parent1b93464c68d398351410d871826e30066bfdbb2f
[FEATURE] Allow to override htmlTag attributes

The new Site handling functionality should ideally avoid
TypoScript conditions as much as possible. However,
if someone wanted to add attributes via config.htmlTag_setParams
all language-dependant properties (e.g. dir and lang) which
are generated by the site configuration are gone, leading to the
way of having to workaround this issue by using stdWrap or conditions)

In order to re-implement this functionality but also build on a
more flexible level, a new TypoScript property
"config.htmlTag.attributes." is added, which is an array
for setting attributes to the <html> tag dynamically.

This superseds the previous config.htmlTag_setParams option
by providing a more flexible API to add attributes.

`config.htmlTag.attributes.class = no-js`

It is even possible to add attributes without a value:
`config.htmlTag.attributes.amp = `

would render `<html lang="en" amp>` - keeping the existing
parameters that are set by other TypoScript anyways.

Resolves: #87033
Releases: master
Change-Id: I6a18671fffbf97aab8d3dda938dc261706e4e6fd
Reviewed-on: https://review.typo3.org/58976
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Benjamin Kott <benjamin.kott@outlook.com>
Tested-by: Benjamin Kott <benjamin.kott@outlook.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Documentation/Changelog/9.5.x/Feature-87033-NewTypoScriptPropertyConfightmlTagattributes.rst [new file with mode: 0644]
typo3/sysext/frontend/Classes/Http/RequestHandler.php
typo3/sysext/frontend/Classes/Page/PageGenerator.php
typo3/sysext/frontend/Tests/Unit/Http/RequestHandlerTest.php