Templates
The Anthology extension uses the Fluid templating engine to render its output. This allows for full control over the HTML markup. You can customise every aspect of the plugin's appearance by overriding the default templates.
Default Template Structure
The extension's templates are located in its Resources/ directory:
- Templates/
- Contains the main template files for each action (e.g.,
List.,html View.).html - Partials/
-
Contains reusable snippets of code that are used in the main templates. This is where the most common customisations are made.
List/: Renders a single record in the list view.Record. html List/: Renders the pagination widget.Pagination. html List/: Renders the container for the filters.Filters. html Filter/...: Contains the templates for the different filter types (e.g.,Date.,html Search.).html
- Layouts/
- Defines the overall HTML structure of the templates.
Overriding Templates
Model specific overrides
To provide templates to the Anthology plugin for specific models, use the following TypoScript:
plugin.tx_llanthology {
settings {
view {
modelname {
templateRootPaths.123456789 = EXT:my_site_package/Resources/Private/Templates/ModelName/
partialRootPaths.123456789 = EXT:my_site_package/Resources/Private/Partials/ModelName/
layoutRootPaths.123456789 = EXT:my_site_package/Resources/Private/Layouts/ModelName/
}
}
}
}
Note
The plugin. key must be lowercase and match the model's name, i.e. Domain\ -> plugin.
Extension-wide overrides
Alternatively, you can provide template overrides for Anthology as a whole:
plugin.tx_llanthology {
settings {
view {
templateRootPaths.123456789 = EXT:my_site_package/Resources/Private/Templates/ModelName/
partialRootPaths.123456789 = EXT:my_site_package/Resources/Private/Partials/ModelName/
layoutRootPaths.123456789 = EXT:my_site_package/Resources/Private/Layouts/ModelName/
}
}
}
Ensure that the key for each of the entries for model specific, or extension-wide, overrides are unique to avoid clashes.
Available Variables
Inside the templates, you have access to several variables:
- paginator
- A paginator object that contains the records for the current page (
paginator.).paginated Items - pagination
- The pagination object for building the page links.
- filters
- A list of the configured filter objects.
- record
- In the
singleview and theAction List/partial, this variable holds the current record being displayed.Record. html - settings
- The settings array from the plugin's FlexForm.