Help! Recent unexpected behaviour in template layouts. Is this a platform bug?

Solved
Highlighted
New Member
2 1 0

Hi everyone!

Recently my shop started failing by not rendering the correct layout that I defined in a custom page.

This is how my page's code looks:

 

 

 

 

{% layout 'narrative-theme.liquid' %}

{% section 'narrative-hero' %}
{% section 'narrative-custom-content' %}
{% section 'narrative-splitslider' %}
{% section 'narrative-feature-row' %}

 

 

 

 

 

The problem presents itself in a very confusing way. My custom page renders correctly in the editor, in previews, and whenever the Shopify Admin bar at the bottom is present, the constant here is that I am logged in as an admin to my account. Whenever I visit the page's url from an incognito session, a different browser, or mobile phone, the page renders incorrectly. The page renders as if the first line in the snippet above were not present, using the default layout, which completely breaks my custom page.

I would appreciate if anyone who has experienced this can give me any advice, my store is live and all I can do right now is shut down the faulty sections.

Best!

0 Likes
Highlighted
New Member
2 1 0

This is an accepted solution.

After some tests I managed to get my site working again.

The problem was that I was using the full file name to reference the layout:

{% layout 'narrative-theme.liquid' %}

 

After I removed the suffix, it started working as before.

{% layout 'narrative-theme' %}

 

This issue was very confusing to me because the full name used to work until recently. And even when it failed in live mode, previews were still rendering correctly, which makes me think there has been a recent change in the way Shopify optimizes live code.

0 Likes