Forms
Forms let you gather information from your website through visitors completing an online “form”. Most common uses include a contact form with fields such as name, email address, and comments.
Form templates are a cross between a page template and a module template as form templates allow content areas in addition to looping through the form fields designed through the administrative section.
Example default.liquid form template:
<h2>{{ form.title }}</h2>
{{ content.body }}
{% if form.submitted? %}
{{ form.confirmation_message }}
{% else %}
{% if entry.errors? %}
<p>There are errors prohibiting this form from being sent:</p>
<ul>
{% for error in entry.errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
{{ form | start_form }}
<dl class="form">
{% for field in form.fields %}
<dt>{{ field.title }} {% if field.required? %}<span class="star">*</span>{% endif %}</dt>
{% if field.helper_text? %}<dd>{{ field.helper_text }}</dd>{% endif %}
<dd>{{ field | field_type: form, session }}</dd>
{% endfor %}
</dl>
<p>{{ form | submit_tag }}    <span class="star">*</span> <small>Indicates a required field</small></p>
{{ form | end_form }}
{% endif %}