Important: #95714 - Null attributes are omitted in media rendering
See forge#95714
Description
The media file renderers
\TYPO3\CMS\ Core\ Resource\ Rendering\ Audio Tag Renderer \TYPO3\CMS\ Core\ Resource\ Rendering\ Video Tag Renderer \TYPO3\CMS\ Core\ Resource\ Rendering\ Vimeo Renderer \TYPO3\CMS\ Core\ Resource\ Rendering\ You Tube Renderer
now treat the values of the
additional option the same way
Fluid's
\TYPO3Fluid\ does:
nullandfalseomit the attribute entirelytruerenders a boolean attribute, the name without a value- An empty string renders
name="" - Any other value renders
name="value"
Up to now,
null
and
false
were both rendered as
name=""
.
In the Vimeo and YouTube renderers,
null
additionally triggered the
deprecation notice
htmlspecialchars.
This allows leaving out an attribute conditionally, which was not possible before:
<f:media file="{file}" additionalAttributes="{poster: posterUrl}" />
If
poster is not set, the
poster
attribute is now dropped
instead of being rendered as
poster=""
.
Attributes carrying an empty string are still rendered. In HTML,
muted
and
muted=""
mean the same thing, so dropping them would change the
meaning of the generated markup.