Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.launchmystore.io/llms.txt

Use this file to discover all available pages before exploring further.

Aqua Tags

Tags create logic, loops, and control the template flow. They’re wrapped in {% %}.

Control Flow

if / elsif / else

Conditional rendering based on truthiness.
{% if product.available %}
  <button>Add to Cart</button>
{% elsif product.coming_soon %}
  <button disabled>Coming Soon</button>
{% else %}
  <button disabled>Sold Out</button>
{% endif %}
Operators:
OperatorDescription
==Equal
!=Not equal
>Greater than
<Less than
>=Greater or equal
<=Less or equal
containsString/array contains
andLogical AND
orLogical OR
{% if product.price > 100 and product.available %}
  Premium & Available
{% endif %}

{% if product.tags contains 'sale' %}
  On Sale!
{% endif %}

unless

Inverse of if - renders when condition is false.
{% unless product.available %}
  <span class="sold-out">Sold Out</span>
{% endunless %}

case / when

Switch statement for multiple conditions.
{% case product.type %}
  {% when 'Shirt' %}
    <p>Check our size guide</p>
  {% when 'Shoes' %}
    <p>Available in US sizes</p>
  {% when 'Accessory' %}
    <p>One size fits all</p>
  {% else %}
    <p>Standard sizing</p>
{% endcase %}

Iteration

for

Loop through arrays and ranges.
{% for product in collection.products %}
  <div class="product">
    {{ product.title }}
  </div>
{% endfor %}
Loop variables:
VariableDescription
forloop.indexCurrent index (1-based)
forloop.index0Current index (0-based)
forloop.firstIs first iteration
forloop.lastIs last iteration
forloop.lengthTotal iterations
forloop.rindexReverse index (1-based)
forloop.rindex0Reverse index (0-based)
{% for product in collection.products %}
  <div class="product {% if forloop.first %}first{% endif %}">
    {{ forloop.index }}. {{ product.title }}
  </div>
{% endfor %}
Parameters:
{# Limit results #}
{% for product in collection.products limit: 4 %}

{# Skip items #}
{% for product in collection.products offset: 2 %}

{# Reverse order #}
{% for product in collection.products reversed %}

{# Combine parameters #}
{% for product in collection.products limit: 4 offset: 2 reversed %}
Ranges:
{% for i in (1..5) %}
  {{ i }}
{% endfor %}
else (empty array):
{% for product in collection.products %}
  {{ product.title }}
{% else %}
  No products found.
{% endfor %}

break / continue

Control loop execution.
{% for product in collection.products %}
  {% if product.price > 1000 %}
    {% continue %}
  {% endif %}
  
  {{ product.title }}
  
  {% if forloop.index >= 10 %}
    {% break %}
  {% endif %}
{% endfor %}

cycle

Alternates between values.
{% for product in collection.products %}
  <div class="{% cycle 'odd', 'even' %}">
    {{ product.title }}
  </div>
{% endfor %}
Named cycles for nested loops:
{% cycle 'row': 'row-1', 'row-2' %}
{% cycle 'col': 'col-1', 'col-2', 'col-3' %}

tablerow

Generates HTML table rows.
<table>
  {% tablerow product in collection.products cols: 3 %}
    {{ product.title }}
  {% endtablerow %}
</table>
Parameters: cols, limit, offset

Variable

assign

Creates or updates a variable.
{% assign featured_product = all_products['product-handle'] %}
{% assign sale_price = product.price | times: 0.9 %}

capture

Captures output into a variable.
{% capture product_info %}
  <span class="title">{{ product.title }}</span>
  <span class="price">{{ product.price | money }}</span>
{% endcapture %}

{{ product_info }}

increment / decrement

Creates and modifies counter variables.
{% increment counter %}  {# 0 #}
{% increment counter %}  {# 1 #}
{% increment counter %}  {# 2 #}

{% decrement counter %}  {# -1 #}
{% decrement counter %}  {# -2 #}

Theme Tags

render

Renders a snippet with isolated scope.
{% render 'product-card', product: product %}
{% render 'icon', name: 'cart', size: 24 %}
With for loop:
{% render 'product-card' for collection.products as product %}
Variables inside render are isolated - they don’t leak to the parent template.

include

Renders a snippet with shared scope (legacy).
{% include 'snippet-name', variable: value %}
Prefer render over include. Include shares scope which can cause variable collisions.

section

Renders a section (in layouts).
{% section 'header' %}
{% section 'footer' %}

sections

Renders a section group (JSON file).
{% sections 'header-group' %}
{% sections 'footer-group' %}

layout

Specifies which layout to use.
{% layout 'theme' %}
{% layout 'alternate' %}
{% layout none %}

content_for

Dynamic block/section rendering.
{% content_for 'block', type: 'product-card', id: 'featured' %}
{% content_for 'header' %}

Template Tags

comment

Content inside is not rendered.
{% comment %}
  This won't appear in the output.
  Good for notes and temporarily hiding code.
{% endcomment %}
Single-line shorthand:
{# This is a comment #}

raw

Outputs Aqua syntax literally.
{% raw %}
  {{ this.will.not.be.parsed }}
  {% this.either %}
{% endraw %}

aqua

Multiple tags in condensed format.
{% aqua
  assign featured = collection.products | first
  if featured.available
    assign status = 'available'
  else
    assign status = 'sold-out'
  endif
%}

echo

Output inside aqua blocks.
{% aqua
  assign name = 'World'
  echo 'Hello ' | append: name
%}

Form Tags

form

Creates HTML forms with CSRF protection.
{% form 'contact' %}
  {{ form.errors | default_errors }}
  
  <input type="email" name="contact[email]" required>
  <textarea name="contact[body]"></textarea>
  <button type="submit">Send</button>
{% endform %}
Form types:
TypePurpose
contactContact form
customer_loginLogin form
create_customerRegistration
recover_customer_passwordPassword reset request
reset_customer_passwordSet new password
activate_customer_passwordActivate account
customer_addressAddress form
new_commentBlog comment
productAdd to cart
cartCart update
localizationCountry/language picker
currencyCurrency selector
storefront_passwordPassword page
Product form example:
{% form 'product', product %}
  <select name="id">
    {% for variant in product.variants %}
      <option value="{{ variant.id }}">{{ variant.title }}</option>
    {% endfor %}
  </select>
  <input type="number" name="quantity" value="1" min="1">
  <button type="submit">Add to Cart</button>
{% endform %}
Form object properties:
PropertyDescription
form.errorsValidation errors
form.posted_successfully?Submission success
form.password_neededPassword required

Pagination

paginate

Paginates arrays.
{% paginate collection.products by 12 %}
  {% for product in collection.products %}
    {{ product.title }}
  {% endfor %}
  
  {% if paginate.pages > 1 %}
    <nav class="pagination">
      {% if paginate.previous %}
        <a href="{{ paginate.previous.url }}">Previous</a>
      {% endif %}
      
      {% for part in paginate.parts %}
        {% if part.is_link %}
          <a href="{{ part.url }}">{{ part.title }}</a>
        {% else %}
          <span class="current">{{ part.title }}</span>
        {% endif %}
      {% endfor %}
      
      {% if paginate.next %}
        <a href="{{ paginate.next.url }}">Next</a>
      {% endif %}
    </nav>
  {% endif %}
{% endpaginate %}
Paginate object:
PropertyDescription
paginate.current_pageCurrent page number
paginate.pagesTotal pages
paginate.itemsTotal items
paginate.page_sizeItems per page
paginate.current_offsetCurrent offset
paginate.previousPrevious page object
paginate.nextNext page object
paginate.partsPage number links

Section Schema

schema

Defines section/block configuration (JSON).
{% schema %}
{
  "name": "Featured Product",
  "settings": [
    {
      "type": "product",
      "id": "product",
      "label": "Product"
    },
    {
      "type": "checkbox",
      "id": "show_vendor",
      "label": "Show vendor",
      "default": true
    }
  ],
  "presets": [
    {
      "name": "Featured Product"
    }
  ]
}
{% endschema %}
See Schema Reference for full documentation.

stylesheet

Scoped CSS for sections.
{% stylesheet %}
  .featured-product {
    padding: 2rem;
    background: {{ section.settings.background_color }};
  }
{% endstylesheet %}

javascript

Scoped JavaScript for sections.
{% javascript %}
  document.addEventListener('DOMContentLoaded', () => {
    console.log('Section loaded');
  });
{% endjavascript %}

Whitespace Control

Add hyphens to strip whitespace:
{%- assign name = 'value' -%}
{{- output -}}
SyntaxEffect
{%-Strip before
-%}Strip after
{{-Strip before output
-}}Strip after output
Example:
{# With whitespace #}
{% assign x = 1 %}
{{ x }}

{# Without whitespace #}
{%- assign x = 1 -%}
{{- x -}}