Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instead of overriding the whole Form template, override blocks. Do not merge yet #1

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 7 additions & 19 deletions templates/forms/form.html.twig
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
<div class="alert">{{ form.message }}</div>
{% extends "forms/default/form.html.twig" %}

<form name="{{ form.name }}"
action="{{ uri.rootUrl ~ (form.action|default(page.route)) }}"
method="{{ form.method|upper|default('POST') }}" class="contact-form commentsblock">
{% for field in form.fields %}
{% set value = form.value(field.name) %}
<div>
{% include "forms/fields/#{field.type}/#{field.type}.html.twig" %}
</div>
{% endfor %}
{% block form_classes %}
class="contact-form commentsblock"
{% endblock %}

<div class="buttons">
{% for button in form.buttons %}
<button class="pushbutton-wide" type="{{ button.type|default('submit') }}">{{ button.value|default('Submit') }}</button>
{% endfor %}
</div>

{{ nonce_field('form', 'form-nonce') }}

</form>
{% block button_classes %}
class="pushbutton-wide"
{% endblock %}