templates
The templates folder contains private resources. If you are familiar with the directory structure of extensions, this would be the Resources/Private folder. There is a limited set of directories and files, which you can place here.
backend-preview.html
The backend-preview.html can be added to customize the backend preview for
your editors. By default, TYPO3 comes with a standard preview renderer. However,
it is specialized in rendering the preview of Core Content Elements. This means
only Core fields like header
, subheader
or bodytext
are
considered. Therefore, it is advised to provide an own preview for custom
Content Elements. Previews for Page Types are displayed at the top of the
content area and beneath the page title. Previews for Record Types can only
be shown as nested child records of Content Elements in the Page Module like so:
<f:comment>Provide the identifier of the child Collection to render a grid preview</f:comment>
<f:render partial="PageLayout/Grid" arguments="{data: data, identifier: 'tabs_item'}"/>
Note
In backend context, all hidden relations like Collections or file references are displayed by default. Thus, the integrator should style those hidden elements accordingly or simply not render them.
<!-- Hidden relations like Collections -->
<f:for each="{data.relations}" as="item">
<f:if condition="{item.systemProperties.disabled}"><!-- Style or hide --></f:if>
</f:for>
<!-- Hidden file references -->
<f:for each="{data.images}" as="file">
<f:if condition="{file.properties.hidden}"><!-- Style or hide --></f:if>
</f:for>
See also:
- Learn more about templating.
- Learn how to include shared partials
frontend.html
This is the default frontend rendering definition for Content Elements.
You can access your fields by the variable {data}
.
Learn more about templating.
partials
For larger Content Elements, you can divide your frontend.html template into smaller chunks by creating separate partials here.
Partials are included as you normally would in any Fluid template.
Note
Due to current Fluid restrictions, partials have to start with an uppercase letter. This restriction might be lifted in later Fluid versions (v5 or above).
<f:render partial="Component" arguments="{_all}"/>
See also:
- Learn how to share partials between Content Blocks.
layouts
You can also add layouts to your Content Block if needed.
<f:layout name="MyLayout">