Skip to content

Commit

Permalink
Merge pull request #21 from bolt/bugfix/optional-bootstrap-and-layout
Browse files Browse the repository at this point in the history
Optional bootstrap and layout
  • Loading branch information
bobdenotter authored Oct 24, 2020
2 parents 42a4050 + 4d04725 commit 8d2e55c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions templates/form.html.twig
Original file line number Diff line number Diff line change
@@ -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 %}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
{% endif %}

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<style>
{% include '@boltforms/assets/boltforms.css' %}
</style>
Expand Down

0 comments on commit 8d2e55c

Please sign in to comment.