page-content
data processor
New in version 13.2
This data processor \TYPO3\
,
alias page-
, loads all tt_
records from the current
backend layout into
the template with a given identifier for each col
, also respecting slideMode or
collect options based on the page layouts content columns.
An array of Record objects will be passed to the Fluid template. You can use the CObject ViewHelper <f:cObject> to display the content elements.
Table of contents
Options
as
-
- Type
- string
- Required
- false
- Default
- "content"
Name for the variable in the Fluid template.
if
-
- Type
- if condition
- Required
- false
- Default
- ''
Only if the condition is met the data processor is executed.
Example: Use the page-content data processor to display the content
page = PAGE
page {
10 = PAGEVIEW
10 {
paths.10 = EXT:my_sitepackage/Resources/Private/Templates/
dataProcessing.10 = page-content
dataProcessing.10.as = myContent
}
}
Use the identifiers of the columns in the Fluid template:
<main>
<f:for each="{myContent.jumbotron.records}" as="contentElement">
<f:if condition="{contentElement.fullType} = 'tt_content.my_extension_jumbotron'">
<h2>{contentElement.header}</h2>
<f:format.html>{contentElement.bodytext}</f:format.html>
</f:if>
</f:for>
<f:for each="{myContent.left.records}" as="contentElement">
<f:cObject
typoscriptObjectPath="{contentElement.mainType}"
table="{contentElement.mainType}"
data="{contentElement}"
/>
</f:for>
</main>
<aside>
<f:for each="{myContent.right.records}" as="contentElement">
<f:if condition="{contentElement.fullType} = 'tt_content.header'">
<h2>{contentElement.header}</h2>
</f:if>
</f:for>
</aside>
You can use the CObject ViewHelper <f:cObject> to render the content element using typo3/cms-fluid-styled-content or render it your self.
{content
Element. main Type} - Is always "tt_content" for content elements.
{content
Element. full Type} - Is composed of "tt_content.[CType]". For a content element of type text it contains "tt_content.text".
The backend layout is defined like this:
mod.web_layout.BackendLayouts {
default {
title = Default
config {
backend_layout {
colCount = 2
rowCount = 2
rows {
1 {
columns {
1 {
name = Jumbotron
colPos = 1
identifier = jumbotron
slideMode = slide
colspan = 2
}
}
}
2 {
columns {
1 {
name = Left
colPos = 0
identifier = left
}
2 {
name = Right
colPos = 2
identifier = right
slideMode = collectReverse
}
}
}
}
}
}
}
}
Modify the result via AfterContentHasBeenFetchedEvent
New in version 13.4.2 | 14.0
The event AfterContentHasBeenFetchedEvent
has been introduced to adjust the page content fetched by the page-
data processor.
The event AfterContentHasBeenFetchedEvent
can be used to modify the content elements fetched by the page-
data processor.
See the following example: Filter content elements provided by the page-content data processor.