Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Does anyone know how to find, in liquid, which layout is in use? I want to use different snippets based on which layout is in use. I'm finding some workarounds, like for page i can use the .template_suffix, but I'd love to know if there's a more direct way.
Something like {{ layout.name }} would be ideal, to give an idea, but I don't see documentation for a layout object like this. So, if anyone knows of a way, please let me know!
Hi @chris-a-io,
I really don't understand what you want. But if you want to create the different layout you can add a new layout and call a separate layout for templates:
Then use the following code:
{% layout 'name layout' %}
Hope it helps!