Customizing Forms
To provide custom Form field templates or to manipulate the Form body, create the following directory structure:
Field/ <– for customizing form field types
html/
MauticFormBundle/
Builder/
_style.html.twig <– for customizing CSS for Form
form.html.twig <– for customizing the form structure itself
Copy from app/bundles/FormBundle/Resources/views/form.html.twig into the Theme’s Builder directory and/or one or more of the fields templates in app/bundles/FormBundle/Views/Field/*.html.php into the Theme’s field directory. Then customize to the desired layout.
You can add a custom style sheet to the Form by adding a _style.html.twig with your custom CSS to html/MauticFormBundle/Builder. The best way is to copy the content of the default Form styles and modify them to your needs.
Customize field types
Create a new template in the Field directory to change HTML generated by field types. The best way is to copy the original template from app/bundles/FormBundle/Resources/views/Field/*.html.twig and modify it.
How to modify templates including base text.html.twig template
Several templates are including the base text.html.twig template so you may need modify it. In that case you also need to modify templates including it. Change the include statement.
For example email.html.twig including:
{{ include(‘@MauticForm/Field/text.html.twig’, { …
you need change @MauticForm to you theme, for example:
{{ include(‘@themes/MyTheme/Field/text.html.twig’, { …