Feature: #95176 - Introduce <f:transform.html> view helper
See forge#95176
Description
Using Fluid view-helper <f:
provides capabilities to
resolve t3://
URIs, which is used in backend contexts as well. Internally
<f:
relies on an existing frontend context, with
corresponding TypoScript configuration in lib.
being given.
In order to separate concerns better, a new <f:
view helper has been introduced
- to be used in frontend and backend context without relying on TypoScript,
- to avoid mixing parsing, sanitization and transformation concerns in
previously used
Content
method of the frontend rendering process.Object Renderer:: parse Func
Impact
Individual TYPO3 link handlers (like t3://
URIs) can be resolved and
substituted without relying on TypoScript configuration and without mixing
concerns in Content
by using Fluid view-helper
<f:
.
Syntax
<f:
selector
: (optional) comma separated list of node attributes to be considered, for examplesubjects="a.
(defaulthref,a. data- uri,img. src" a.
)href -
on
(optional) corresponding behavior, in case transformation failed, for example URI was invalid or could not be resolved properly (defaultFailure remove
). Based on exampleEnclosure <a href="t3://
. corresponding results of each behavior would be like this:INVALID">value</ a> remove
:Enclosure value
(removed enclosing tag)remove
:Tag (removed tag, incl. child nodes)
remove
:Attr <a>value</
(removed attribute)a> null
:<a href="t3://
(unmodified, as given)INVALID">value</ a>
Example
<f:transform.html selector="a.href,div.data-uri">
<a href="t3://page?uid=1" class="page">visit</a>
<div data-uri="t3://page?uid=1" class="page trigger">visit</div>
</f:transform.html>
... will be resolved and transformed to the following markup ...
<a href="https://typo3.localhost/" class="page">visit</a>
<div data-uri="https://typo3.localhost/" class="page trigger">visit</div>