OS 2.0 - Sections Per Page?

nickkos
Tourist
5 0 1

So I did a conversion of my site to OS 2.0 a while back. One of the intriguing things about OS2 is the changes made to section templates, with the ability to have a section repeat itself in multiple instances.

However, in practice I have found either an incredibly stupid limitation, or an unintuitive interface.

I have a page template called bio.page.json. Inside that renders the bio-section.liquid section file. I have 20-30 "bio page" templates. However the section file is not "reusable" on a per page basis. Once the customizer content is edited for that section it applies to every single page with the bio template. I thought one of the use cases of section everywhere was to eliminate the need to create a ton of files for reusable content.

Am I missing something? I want unique content in each section per page!!!

0 Likes
iDoThemes
Pathfinder
90 19 35

I've used this without issue so it should work.

Are these sections you've created yourself? It's possible you missed some attributes from the main section file div, like:

<div data-section-id="{{ section.id }}" data-section-type="header-section">

 Or 

<section class="section--featured-collection" id="section-{{ section.id }}">

 

Though i'd have thought these would be autofilled if not present. What does the data structure of your new .json template look like? If it's correctly creating unique IDs you should see something like
Bed Threads ~ Edit ~ [Dev] Byob Table Luke ~ Shopify 2021-08-04 15-29-53.png

Where each key inside the sections object has a unique name where the data for that section is stored. 

Developer of Liquify Chrome Extension -- Enhance the Shopify Theme Code Editor

Theme Developer -- Drop me a line
0 Likes