Render.contentArea ViewHelper <f:render.contentArea>
New in version 14.2
Instead of using the
<f: and
<f: ViewHelpers to
render content areas, use the new
<f: ViewHelper.
This ViewHelper can be used to render a content area provided by the page-content data processor.
It is commonly used with the PAGEVIEW TypoScript content object.
Theme creators are encouraged to use the
<f: ViewHelper
to allow other extensions to modify the output via event listeners.
Go to the source code of this ViewHelper: Render\ContentAreaViewHelper.php (GitHub).
Table of contents
Rendering all content elements within a backend layout column
The most common use case for the <f: is to render all
content elements within a column from a backend layout.
<f:render.contentArea contentArea="{content.main}"/>
Or using inline syntax:
{content.main -> f:render.contentArea()}
page = PAGE
page {
10 = PAGEVIEW
10 {
paths.10 = EXT:my_sitepackage/Resources/Private/Templates/
dataProcessing.10 = page-content
}
}
For an example of how to configure the backend layout in page TSconfig and further data processor options, see Example: Use the page-content data processor to display the content.
Using the "recordAs" argument to wrap each content element
Using the recordAs
argument, <f: can be combined with the
Render.record ViewHelper <f:render.record>
to wrap each content element:
<div id="sidebar">
<f:render.contentArea contentArea="{content.left}" recordAs="record">
<div id="sidebarItem{record.uid}">
<f:render.record record="{record}" />
</div>
</f:render.contentArea>
</div>
Intercepting the rendering of content areas via an event
Developers can intercept the rendering of content areas in Fluid templates using
\TYPO3\ to modify output.
Arguments of the <f:render.contentArea> ViewHelper
contentArea
-
- Type
- TYPO3\CMS\Core\Page\ContentArea
A content area from the page-content processor
recordAs
-
- Type
- string
Name of the variable to store the current record in, if you want to use it in the before/after content.