/

August 5, 2024

How To Add A Shopify Section To Other Pages on Your Site

Your Shopify site’s home page has various types of sections like banner, announcement bar, image with text, featured collection, video with text, and many more and according to your requirement you used it but sometimes you want a limited section on your home page and you want to create the separate template with section file.

In this blog, we will show you how to create the Shopify section on other pages.

First go to Shopify admin > Themes > Actions > Edit code

In the left sidebar, there are many folder options like sections, Assets, Snippet, and many more, But we want to create the section first and then after it embeds into the template page.

here we create the new section with a custom-video-section.liquid file.

we want to add the section of video with text so copy all the code from the existing file and paste this code into the new section created(custom-video-section.liquid) and save it.

you can get any section that already exists in your store and copy all the code and paste it into your newly created section.

 

we create a new section name custom-video-text.

 

After that copy all the code from the existing section file and paste it into the newly created section file.

 

Assign the section to your page template

This is where it gets a little tricky. You can either create a new page template and then assign that template to a page or just add the section to an existing page.

Under the “Templates” folder on the left-hand side panel, find the template that you’d like to add the section to.

in our example we want to create the new page template file page.video.text.liquid where include the section file custom-video-section.liquid

 

Once you have selected the correct template, you’ll see the code appear on the right panel. After the {{page.content}} add the code: {% section ‘custom-video-section.liquid’ %} where ‘custom-video-text.liquid’ is the name you gave that newly created section file,save the file by clicking on the green “Save” button on the right.

 

After that go to Shopify admin> theme > customization

and search your page template video-text from the top bar and see your result.

 

From the same category