Trying to use sections in custom page template instead of snippets

Solved

Trying to use sections in custom page template instead of snippets

mgibson323
Tourist
7 1 2

Hello,

 

I am working on updating the theme on my shop (Canopy). 

 

As part of this work, I wish to use the updated theme's contact-form.liquid from the sections folder.

 

However, no matter what I do, my custom page template insists on trying to use the snippets folder.

 

The code for the custom page is quite simple, I will share it here:

 

 

<div class="container">
  <div class="reading-column">
    <h1 class="page-title">{{ page.title }}</h1>

    <div class="page-with-contact-form">
      <div class="rte">{{ page.content | replace: 'fullwidth"', '" data-fullwidth="true"' }}</div>

      <div class="section">
        <div style="width: 80%; margin-left:9%; padding: 1%;">
        {% render 'contact-form' %}
        </div>
      </div>
    </div>
  </div>
</div>

 

 

I've searched multiple different ways and cannot seem to find an answer.  Here is what I have tried:

1.

 

      <div class="section">
        <div style="width: 80%; margin-left:9%; padding: 1%;">
        {% render '../sections/contact-form' %}
        </div>

 

2.

 

      <div class="section">
        <div style="width: 80%; margin-left:9%; padding: 1%;">
        {% render '/sections/contact-form' %}
        </div>

 

 

Neither method works, though.

 

How can I tell the theme to use the sections folder instead of the snippets folder for this custom page?

Accepted Solution (1)
mgibson323
Tourist
7 1 2

This is an accepted solution.

Replies 3 (3)

suyash1
Shopify Partner
9550 1194 1532

@mgibson323 - when you use word render, it goes to snippets

Support me | To build shopify pages use pagefly | You are welcome to contact me - suyash.patankar@gmail.com , My timezone is GMT+5:30.
mgibson323
Tourist
7 1 2
Okay, thanks. So what word should I use instead?
mgibson323
Tourist
7 1 2

This is an accepted solution.

I've discovered it myself here:

https://shopify.dev/docs/api/liquid/tags/section