Forms
The {% form %} Liquid tag outputs HTML <form> elements wired to Finqu storefront endpoints for customer login, registration, contact forms, search, reviews, and localization.
For add-to-cart flows, use the Storefront API or Storefront SDK rather than the legacy product form type.
Basic syntax
{% form 'login' %}
{% if form.error %}
<p class="error">{{ form.error }}</p>
{% endif %}
<label>
Email
<input type="email" name="email" value="{{ form.submitted.email }}" required>
</label>
<label>
Password
<input type="password" name="password" required>
</label>
<button type="submit">Sign in</button>
{% endform %}The first argument is the form type string. Some form types also require a Liquid context object (for example article for comment or product for review). Finqu generates the <form> element with the required action, method, and hidden fields; place your inputs and submit button inside the tag body.
The form object
Inside a {% form %} block, Finqu exposes a form object containing the previous submission’s state:
Available form types
Storefront themes support these form types:
Only the form types listed above are supported in storefront themes.
Examples
Customer registration
{% form 'create_customer' %}
{% if form.error %}
<p class="error">{{ form.error }}</p>
{% endif %}
<label>First name <input type="text" name="first_name" value="{{ form.submitted.first_name }}" required></label>
<label>Last name <input type="text" name="last_name" value="{{ form.submitted.last_name }}" required></label>
<label>Email <input type="email" name="email" value="{{ form.submitted.email }}" required></label>
<label>Password <input type="password" name="password" required></label>
<button type="submit">Create account</button>
{% endform %}Search
{% form 'search' %}
<input type="search" name="q" placeholder="Search products...">
<button type="submit">Search</button>
{% endform %}Constraints and notes
- Checkout themes do not support
{% form %}; checkout interactions use the Vue checkout library instead. - Pass a unique
idattribute whenever two forms of the same type appear on one page, such as{% form 'login', id: 'header-login' %}. - See the Store tags reference for full tag parameters.