Why not use block tags for Liquid in Shopify?
Liquid has evolved and continues to evolve as a template language. When it was first released, one could only do certain patterns. As it evolved, it became easier to do new patterns as new keywords and supporting parsers were released. Liquid is open source and so many have adopted it and enhanced it too. When Shopify sees others doing something nice, they often adopt it for their Liquid. Anyway, long story short, you can indeed open up a Liquid block, write some statements, and then close it off. We also had a long and varied debate on making comments nicer. You can take advantage of nicer comment structures now too. Progress!
There is no technical reason to avoid perfectly legit tag usage. At the end of the day, the Shopify machine compresses and parses all that Liquid into a single huge string of HTML and dumps it all to the browser, no worries about you issuing as one block or a bunch of smaller ones to get something done.
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.