Files and Usage

1. Layouts

Layout files in Shopify Liquid provide a way to maintain consistent design elements across multiple pages. By creating a layout, you can define the common structure for all pages on your store.

<!DOCTYPE html>
  <title>{{ page.title }}</title>
  {{ content_for_layout }}

2. Templates

Templates are used to structure the content and layout of individual pages on your Shopify store. Each template corresponds to a specific page type, such as product pages, collection pages, or the homepage.

<!-- product.liquid -->
<h1>{{ product.title }}</h1>
<p>{{ product.description }}</p>

3. Includes

Includes are reusable snippets of code that can be used across multiple templates. They help in modularizing your Liquid code and promoting code reusability.

<!-- header.liquid -->
    <!-- Navigation links go here -->

4. Sections

Sections are content blocks that can be added and customized on different pages of your Shopify store. They allow merchants to modify the layout and content of pages without touching the theme code directly.

{% section 'slider' %}
{% section 'featured-products' %}