Overriding the Fluid templates
At TypoScript we have described the way content elements are rendered.
By default these settings are done in the setup.
file which can be found in the
EXT:
folder.
Using the site settings
New in version 13.1
You can now use site settings to override the template paths.
In order to override the templates used in fluid_
you need a
custom site package.
You can override the default template paths from the Site set "Fluid Styled Content" in your site configuration:
styles:
templates:
templateRootPath: EXT:my_site_package/Resources/Private/Extensions/FluidStyledContent/Templates/
partialRootPath: EXT:my_site_package/Resources/Private/Extensions/FluidStyledContent/Partials/
layoutRootPath: EXT:my_site_package/Resources/Private/Extensions/FluidStyledContent/Layouts/
Now copy the Fluid templates that you want to override into your site package at the path configured in the site settings.
Using lib.contentElement
Changed in version 13.1
It is recommended to use
site settings instead of
lib.
to override the template paths.
This option gives you the ability to add another template
and can be defined
the same as partial
and layout
:
lib.contentElement {
templateRootPaths {
200 = EXT:your_extension_key/Resources/Private/Templates/
}
partialRootPaths {
200 = EXT:your_extension_key/Resources/Private/Partials/
}
layoutRootPaths {
200 = EXT:your_extension_key/Resources/Private/Layouts/
}
}
A content element is using a template
, which is defined in setup.
. You
can override this value, but the template from the extension fluid_styled_content will
not be loaded as its name is still the default value.
tt_content {
bullets {
templateName = ChangedName
}
}