From 4d04725aa2ec02ce55697b3033c4049b48a0c675 Mon Sep 17 00:00:00 2001 From: Ivo Valchev Date: Fri, 23 Oct 2020 15:37:26 +0200 Subject: [PATCH] Optional bootstrap and layout --- config/config.yaml | 5 +++++ templates/form.html.twig | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index bed2fcb..efbc5c4 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -39,6 +39,11 @@ templates: subject: '@boltforms/subject.html.twig' files: '@boltforms/file_browser.twig' +# If the default templates are used, customise the layout. +layout: + form: 'form_div_layout.html.twig' # or see all options here: https://github.com/symfony/symfony/tree/5.x/src/Symfony/Bridge/Twig/Resources/views/Form + bootstrap: false # if true, bootstrap will automatically be included. + ## reCAPTCHa set up # # NOTE: You can get your keys from https://www.google.com/recaptcha/admin diff --git a/templates/form.html.twig b/templates/form.html.twig index 1a33ffa..3739419 100644 --- a/templates/form.html.twig +++ b/templates/form.html.twig @@ -1,7 +1,11 @@ {# this tag only applies to the forms defined in this template #} -{% form_theme form 'bootstrap_4_layout.html.twig' %} +{% set layout = config.layout.form|default('form_div_layout.html.twig') %} +{% form_theme form layout %} + +{% if config.layout.bootstrap %} + +{% endif %} -