Narrative Theme - Sections for page

Solved
Highlighted
Tourist
4 1 1

Hi everyone

I've been trying to figure out how to add sections to pages

I've been trying to do this by setting up at template for a page (page.index.liquid) and paste in: {{ content_for_page_index }}

Just like in index.liquid (which is the template for the home page)

Then in settings_data.json (config file, that has the settings you make in the theme editor) I copied everything (should potentially have done it with the default home page and not the my home page) and edited the blocks (just said plus 1 on all so they were something different from the home page blocks), and all (obvi not for the home page stuff, only my template) the {{ content_for_index }} too {{ content_for_page_index }}, at some point I managed to get the section editor to appear on the page (after some more edits not sure exactly what), but it wasn't working.

But I don't seem to be allowed to save the file with the edits I've mentioned.

 

My shop is Shopify shop 

If anyone ask I'll post the file, but decided not to since its 1500-2000 lines

Rovox Web Design
Rovoxwd@gmail.com
0 Likes
Highlighted
Shopify Partner
591 84 127

This is an accepted solution.

it is easy. Make a section file in sections named for example my-section.
Then in the file from where you want to call section, just put this code

 


{% section 'my-section' %}

If this solution works, then please accept it as solution and like.
For theme customization, please contact parambabla.soft@gmail.com
Highlighted
Tourist
4 1 1

This is an accepted solution.

Figured out what you meant.

 

For anyone else, if you make a template and then paste in {% section '[section.name]' %} ([section.name] being the name of the section don't paste that exact line) this will allow you to have sections, you will have to do that for every section you want and then edit it in theme editor, but it works.

Rovox Web Design
Rovoxwd@gmail.com
0 Likes