Feature: #73409 - Auto-render Assets sections in Fluid template with controller ¶
See Issue #73409
ActionController has received a new method,
which receives the
Request currently being processed. The ActionController has a default implementation of this method which attempts
to render two sections in the Fluid template that is associated with the controller action being called:
<f:section name="HeaderAssets">for assets intended for the
<f:section name="FooterAssets">for assets intended for the end of the
Both sections are optional.
is available as template variable in both sections, as is
, allowing you
to make decisions based on various request/controller arguments. As usual,
is also available.
All content you write into these sections will be output in the respective location as is, meaning you must write the entire
or whichever tag you are writing, including all attributes. You can of course use various Fluid ViewHelpers
to resolve extension asset paths.
The feature only applies to ActionController (thus excluding CommandController) and will only attempt to render the
section if the view is an instance of
(thus including any View in TYPO3 which
extends either TemplateView or AbstractTemplateView from TYPO3’s Fluid adapter).
Fluid templates rendered through any ActionController using a TemplateView may now contain two new sections for
FooterAssetsdepending on desired output. Content of these sections will be rendered and assigned via PageRenderer to either header or footer.
ActionControllers can override the
renderAssetsForRequestmethod to perform asset insertion using other means. The method sits at a very opportune point right after the action method itself gets called, when the entire controller is fully initialized with arguments etc. but no forwarding/redirection has happened in the controller action.