Like some of the releases on the Shopify documentation this is something that deserved way more attention than it got. Hacking articles to do cool things has been around for as long as the blogs have.
Having partners and developers shift off those JS hacks and move over to Liquid is a solid win for everyone. It's also damn cool.
Let's take a look at a live example that shows some code looping over a few predefined articles. The article values are stored in a metafield, and I've made a point of grabbing some articles from different blogs. Check out the Showing specific blog posts in a blog post post. (That was fun to type).
The code for this is super basic with the logic largely:
- get the metafield
- split the value
- loop over the array
- clean the whitespace from each array during the loop
- use that to reference an article, and show a title on the page.
grabbing the liquid snippet...