Skip to Content

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:

PropertyDescription
form.posted_successfully?true after a successful submission
form.errorError message from the last failed submission
form.submittedPreviously submitted field values for repopulating inputs

Available form types

Storefront themes support these form types:

Form typePurposeRequired object
loginCustomer sign-inNone
create_customerCustomer registrationNone
edit_customerCustomer account editNone
change_customer_passwordPassword changeNone
recover_customer_passwordPassword recovery requestNone
reset_customer_passwordPassword resetNone
contactStore contact formNone
searchCatalog searchNone
commentBlog article commentarticle
reviewProduct reviewproduct
productLegacy add-to-cart formproduct
store_passwordPassword-protected store accessNone
cookie_policyCookie consentNone
localizationLanguage and currency switcherNone
customerGeneric customer formNone

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 %}
{% 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 id attribute 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.