I have multiple sections that constitute a template
In liquid I need to know the section that appears first so I can explicitly tell it NOT to lazy load images.
I was hoping a property like section.index existed but it does not.
I don’t want to have to create a setting in each of my section schemas to toggle on/off lazy loading that I have to manually set depending on its order on the page.
I thought I could possibly have a variable increment at the beginning of each section, but then I realised that those variables don’t carry over to other sections, only snippets.
The downside is that you can’t target a section group. Which means that the first section of the “footer” section group will return an index of 1, but since it’s the footer its not relevant to eager load. This feature seems half baked like many new feature release, but it’s in its infancy so they might improve it.
We’d need something along these lines but unfortunately not possible at the moment:
Thanks @MaxDesign . It works now on its own and this has also been added to the Liquid documentation (last time I checked at the time of my previous comment, it wasn’t)