Render.contentArea ViewHelper <f:render.contentArea> 

New in version 14.2

Instead of using the <f:cObject> and <f:for> ViewHelpers to render content areas, use the new <f:render.contentArea> 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:render.contentArea> ViewHelper to allow other extensions to modify the output via event listeners.

Go to the source code of this ViewHelper: Render\ContentAreaViewHelper.php (GitHub).

Rendering all content elements within a backend layout column 

The most common use case for the <f:render.contentArea> is to render all content elements within a column from a backend layout.

packages/my_sitepackage/Resources/Private/Templates/Page/Default.html
<f:render.contentArea contentArea="{content.main}"/>
Copied!

Or using inline syntax:

packages/my_sitepackage/Resources/Private/Templates/Page/Default.html
{content.main -> f:render.contentArea()}
Copied!
packages/my_sitepackage/Configuration/Sets/main/setup.typoscript
page = PAGE
page {
    10 = PAGEVIEW
    10 {
        paths.10 = EXT:my_sitepackage/Resources/Private/Templates/
        dataProcessing.10 = page-content
    }
}
Copied!

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:render.contentArea> can be combined with the Render.record ViewHelper <f:render.record> to wrap each content element:

packages/my_sitepackage/Resources/Private/Templates/Page/Default.html
<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>
Copied!

Intercepting the rendering of content areas via an event 

Developers can intercept the rendering of content areas in Fluid templates using \TYPO3\CMS\Fluid\Event\ModifyRenderedContentAreaEvent to modify output.

Arguments of the <f:render.contentArea> ViewHelper 

contentArea

contentArea
Type
TYPO3\CMS\Core\Page\ContentArea
A content area from the page-content processor

recordAs

recordAs
Type
string
Name of the variable to store the current record in, if you want to use it in the before/after content.