Overriding templates
EXT:academic_persons_edit is using Fluid as template engine.
This documentation won't bring you all information about Fluid but only the most important things you need for using it. You can get more information in the section Fluid templates of the Sitepackage tutorial. A complete reference of Fluid ViewHelpers provided by TYPO3 can be found in the ViewHelper Reference
Change the templates using TypoScript constants
As any Extbase based extension, you can find the templates in the directory
Resources/.
If you want to change a template, copy the desired files to the directory where you store the templates.
We suggest that you use a sitepackage extension. Learn how to Create a sitepackage extension.
# TypoScript constants
plugin.tx_academicpersonsedit {
view {
templateRootPath = EXT:mysitepackage/Resources/Private/Extensions/myextension/Templates/
partialRootPath = EXT:mysitepackage/Resources/Private/Extensions/myextension/Partials/
}
}
Profile editing template
Profile editing renders from Resources/Private/Templates/Profile/Index.html
and thirty-one partials below Resources/. Four
of them sit directly in that directory - the header, the status toast, the
button templates and the prototypes - and the rest in four subdirectories:
Field/ for the controls and the two action bars, Documents/ for
the structured sections and their two editors, Image/ for the image card
and the image editor, and Profile/ for the field sections. Any of them
can be overridden on its own.
Two of them carry more than markup. Profile/ is the one
place a form control is spelled - every field, of every section and of both
editors, is that partial - and Profile/ holds the
<template data- blocks the custom elements clone for everything they
draw in the browser. When overriding while keeping the shipped JavaScript,
preserve the form data attributes, the field class and the slot names of those
blocks. The complete contract is documented in Profile editing.
Replacing an icon
The action and state icons of the profile editing frontend are addressed by
identifier, not by file. They are the shared frontend icons of
academic_base, registered in its
Configuration/ for its frontend icon registry as
tx-, -back, -clear, -delete, -drag,
-edit, -help, -move-, -move-, -save, -undo,
-upload-, -view and -view-, and
tx- and -hidden, see
Icon identifiers. The templates render them with the ab:
ViewHelper of academic_base.
To use different artwork, register the identifier again in the
Configuration/ of the sitepackage with the own file.
The sitepackage has to depend on academic_base, so its
registration is read later and wins, and no template has to be overridden:
<?php
use FGTCLB\AcademicBase\Imaging\IconProvider\CurrentColorSvgIconProvider;
return [
'tx-academicbase-action-save' => [
'provider' => CurrentColorSvgIconProvider::class,
'source' => 'EXT:mysitepackage/Resources/Public/Icons/save.svg',
],
];
The replacement reaches the controls the editor builds in the browser as well,
because they are cloned from markup the page renders. An entry in the
Configuration/Icons.php of the sitepackage does not reach the editor.
The identifier is shared by every academic extension, so the replacement applies wherever the action appears, not only in the profile editor.
The provider of the example inlines the file rather than rendering an
<img>
, so the glyph takes the colour of the button it sits in. A file
registered with it carries a view, draws its shapes in current
and has no id attribute - the markup is part of the document, possibly more
than once.
The shipped files are Font Awesome Free solid icons, their licence (CC BY 4.0)
ships beside them in
EXT:.