Section reuse on pages other than Home

Shopify Partner
2 0 2

As far as I know you can only use sections on pages other than the "Home" page by including:

{% section "my-section" %}

 

Now you might have a section "image" and want to use it twice on your "About us" page. It looks like it's not possible because the sections cannot have unique contents.

...
{% section "image" %}
...
{% section "image" %}
...

 

I have already thought that it sucks that you cannot use sections on pages other than Home but if you cannot even reuse them when including them, they are basically useless on all pages other than Home, aren't they? Is there a possiblity to get this working?

So sad. :(

2 Likes
Shopify Partner
4 0 0

Check out Advanced ThemeBuilder in the App Store. it allows the placement of sections into any page, product, post, or collection.

Out of the box it allows sections to go at the top and/or bottom of any content, and advanced uses can create custom zones to place sections mid-content, like after the main product description.

We've been using this App in beta in over a dozen stores over the past year. It has been incredibly helpful.

0 Likes
Tourist
6 0 7

Hey there, we came up with a workaround and wrote a guide which requires no additional plugins or fees and it is fairly easy to implement. Here is the how-to: https://oak.works/blog/technical/2017/03/23/shopify-sections-editor/

 

5 Likes
New Member
1 0 0

Steve, I know I'm jumping in much later, I just want to say that this is absolutely brilliant, and was a really helpful write-up. Thanks so much.

0 Likes
Shopify Partner
33 1 8

If someone is still interested, we provided different approach to this problem here:

https://community.shopify.com/c/Shopify-Design/How-can-i-add-sections-to-a-regular-page/m-p/516155/h...

:)

Best,

Lucas

Open Source Shopify App Store - https://github.com/sellfino/sellfino
Free apps ready to download on GitHub

Join our awesome community! Here is how you can connect with us:
Website - all info here + live chat
Discord - channels to discuss new ideas and ask for help
Messanger - if you want to chat on Facebook
Email - whenever we are out of touch, drop us a message
0 Likes
Shopify Partner
2 0 0

We are going to try this now. If it works this is a genius! Thanks for posting.

0 Likes
New Member
1 0 0

For anyone still looking for a different solution, here's what worked for us. It's NOT a dynamic solution (ie: you won't be able to use the customizer to edit the section on your page – it's all hardcoded). However, it's a great solution for a homepage section you'd like to re-use and won't need updating via the customizer.

 

1. View page source for your homepage

2. Find the HTML for the section you're looking to re-use (it will begin with a div looking something like this: div id="shopify-section-1570644431335")

3. Highlight and copy the entire div and its contents 

4. Go into your Themes section and click Edit Code under your active theme

5. Add a new Snippet in the Snippets folder, and title it whatever you'd like

6. Paste the HTML into your new snippet and click save

7. Next, create a new page template and title it whatever you'd like

8. Look for something like this on your new page template:

    <div class="content-container narrow rte">
      <h1>{{ page.title }}</h1>
      {{ page.content }}
    </div>

9. Use the following code to insert your new snippet wherever you'd like in relation to the page.title or page.content objects:

{% include 'whatever-you-named-your-snippet' %}

10. Save your new page template

11. Open the page you're wanting to include the custom section on in the Pages menu

12. Under template on the right hand side of your screen, use the drop-down to select your new page template and click save.

 

You might need to stylize with additional spacing or CSS in the page template, but this is a sure-fire way to reuse any homepage section anywhere on your site. Hope this helps someone!

0 Likes