Linked Sections Between Templates

Topic summary

Goal: Use one “main” section across multiple templates so edits propagate automatically; also explore duplicating sections between templates.

Proposed approach (Shopify Liquid sections):

  • Create a reusable section file in /sections (e.g., main-section.liquid) containing the desired content and settings. A “section” is a reusable theme component written in Liquid.
  • Insert it wherever needed by adding the Liquid tag: {% section ‘main-section’ %}. Changes to the section file will appear in every template that includes it.
  • To duplicate a section for other templates, copy the section’s Liquid file and include the new file similarly. Note: copied files are separate; only the original included in multiple places stays auto-synced.

Notes: The code snippet is central to the solution.

Status: A clear implementation path is provided; no confirmation from the original poster, so resolution is unconfirmed.

Summarized with AI on December 24. AI used: gpt-5.

Hello,

I need to have a main section on a given template, and duplicates on other templates. They auto update according to edits on the main section.

It would also be good to be able to natively duplicate sections from one template to another, as well.

Any push on how to set this up would be great.

'good day !

  • Create a Section: Start by creating a section file (e.g., main-section.liquid) in your sections directory. Design it with all the content you want.

  • Include the Section: Add {% section ‘main-section’ %} to your templates where you want it to appear. Any changes to the section will automatically update wherever it’s included.

  • Duplicate Sections: To duplicate sections to other templates, you can simply copy the section’s Liquid file and include it in your other templates similarly.