Review main Merged

58976[FEATURE] Allow to override htmlTag attributes

Benni Mack CR +2 V +2 Normal +170 −12 updated 12/03/18, 19:47

Commit message

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.

Review

  • Code review CR +2
    • Benni Mack +2
    • Josef Glatz +1
    • Georg Ringer +1
    • Benjamin Kott +1
  • Verified V +2
    • Benni Mack +2
    • Georg Ringer +1
    • Benjamin Kott +1
    • TYPO3com +1 CI

Issues 1

Files 4

Review log 1214

  1. Benni Mack uploaded patch set 1 11/29/18, 06:46

  2. TYPO3com voted on patch set 1 V +1 11/29/18, 06:58 Completed build in 11m 44s on Thu, 29 Nov, 07:58 AM Test Summary: 48516 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-30337

  3. Soren Malling commented on patch set 1 11/29/18, 13:12

    Just curious and to make sure it's head - but would it make sense to add the `lang` attribute via default typoscript. So the `config.htmlTag.attributes.lang = gettext:site:lang` (pseudo example) is set by default and possible to be overriden/disabled by integrators choice.
  4. Benni Mack commented on patch set 1 11/29/18, 14:03

    Hey Soren, "lang" attribute is automatically added due to site handling. No TypoScript needed. No change through this patch.
  5. Soren Malling commented on patch set 1 CR +1 11/29/18, 14:05

    I am aware of that :-) My suggestion was to move it from the sitehandling into the typoscript feature implemented by this patch. But I can see that as a separate changeset/suggestion later on when this feature is merged.
  6. Benni Mack commented on patch set 1 11/29/18, 14:24

    The good thing is - you can override it now. it's just set by default.
  7. Soren Malling commented on patch set 1 11/29/18, 14:28

    Completely agree :) Code review done from my side. Might have access to my test insstallation later this evening and will do functional review
  8. Josef Glatz commented on patch set 2 11/30/18, 19:54

    Published edit on patch set 1.
  9. Josef Glatz voted on patch set 2 CR +1 11/30/18, 20:00

  10. TYPO3com voted on patch set 2 V +1 11/30/18, 20:05 Completed build in 10m 48s on Fri, 30 Nov, 09:05 PM Test Summary: 48528 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-30376

  11. Georg Ringer voted on patch set 2 V +1 CR +1 12/03/18, 18:02

  12. Benjamin Kott voted on patch set 2 V +1 CR +1 12/03/18, 19:46

  13. Benni Mack voted on patch set 2 V +2 CR +2 12/03/18, 19:47

  14. Benni Mack merged patch set 3 12/03/18, 19:47