Overriding the Fluid template¶
Changed in version 13.3
It is recommended to use the site set settings to override the template paths if possible.
The plugin "Indexed Search" can be extended with custom templates. You need a custom site package to achieve this.
indexedsearch:
view:
templateRootPath: 'EXT:site_package/Resources/Private/Extensions/IndexedSearch/Templates/'
partialRootPath: 'EXT:site_package/Resources/Private/Extensions/IndexedSearch/Partials/'
layoutRootPath: 'EXT:site_package/Resources/Private/Extensions/IndexedSearch/Layouts/'
Now copy the Fluid templates that you want to override in the according paths
in your custom site package extension. For example to override the search form
copy the file EXT:indexed_search/Resources/Private/Partials/Form.html
to EXT:site_package/Resources/Private/Extensions/IndexedSearch/Partials/Form.html
and make your changes in the latter file.
Overriding the template paths via TypoScript¶
If you need to override the Fluid templates from multiple locations or for legacy reasons you do not use site sets yet, you can use TypoScript to override the template root paths:
The plugin "Indexed Search" can be extended with custom templates:
plugin.tx_indexedsearch.view {
templateRootPaths {
0 = EXT:indexed_search/Resources/Private/Templates/
10 = {$plugin.tx_indexedsearch.view.templateRootPath ?? $indexedsearch.view.templateRootPath}
20 = EXT:my_extension/Resources/Private/Templates/
}
partialRootPaths {
0 = EXT:indexed_search/Resources/Private/Partials/
10 = {$plugin.tx_indexedsearch.view.partialRootPath ?? $indexedsearch.view.partialRootPath}
20 = EXT:my_extension/Resources/Private/Partials/
}
}
The configuration in this TypoScript snippet will make the plugin look templates in the following order:
- Paths in
my_extension
(Index 20) - Paths defined by constant and if not defined by settings (Index 10)
- Fall back to the default
indexed_search
templates (Index 0)