For merchants Dynamic Shopify Liquid sections is key to customizing themes. Out with the hard coded content in headers, images, links, and styles and in with easy updates right from the Shopify admin UI. This guide will take you through each step, also we will look at some common issues and more advanced tips.
Why HTML to Liquid Conversion is Important
Static HTML works for prototypes but themes really come into their own when merchants are able to edit content without going to a developer. In Shopify’s theme we use Liquid and a proper schema to make components which are not only reusable but also customizable.
Pro Tip: Begin with an HTML structure analysis to determine the editable components.
Step-by-step Conversion Process
1. Analyze your HTML structure
Every editable components requires a schema setting
- Text content: headings, paragraphs, button text
- Images: hero images, product photos, icons
- Links: button URLs, nav links
- Colors & options: background, text color, accent colors
2. Create schema settings
For each schema setting, create an editable portion, like in the example below
{
"type": "text",
"id": "heading",
"label": "Section Heading",
"default": "Welcome to Our Store"
}
3. Make Static Content to dynamic
Before (Static HTML):
<h2>Welcome to Our Store</h2>
After (Dynamic Liquid):
<h2>{{ section.settings.heading }}</h2>
4. Most Common Mistakes to Avoid
- Default values in your schema are essential; they stop empty UIs.
- Always check your JSON schema for validity.
- Always test the section in the theme customizer before going live to avoid unnecessary fixes.
5. Recommended Practices
- Conditional Logic
- Sections are smarter when they render parts of the UI depending on certain shopify input settings.
{% if section.settings.heading != blank %}
<h2>{{ section.settings.heading }}</h2>
{% endif %}
- Image Optimization
{%- liquid
assign widths = '375, 550, 750, 1100, 1500, 1780, 2000, 3000, 3840'
assign image_height = section.settings.image.width | divided_by: section.settings.image.aspect_ratio
assign fetch_priority = 'auto'
if section.index == 1
assign fetch_priority = 'high'
endif
-%}
{{
section.settings.image
| image_url: width: 3840
| image_tag:
width: section.settings.image.width,
height: image_height,
widths: widths,
fetchpriority: fetch_priority
}}
6. Converting requires extensive testing
For your pre-live checklist, make sure to:
- Upload the section file to your development theme.
- Use the theme customizer to include the section on a page.
- Test every setting, including text, images, URLs, and toggles.
- Review mobile and tablet responsive behavior.
- Inspect and validate HTML/CSS, correcting any mismatches.
- Default values must be set and visible to confirm the section renders without any interaction.


