Statically Generate Shopify Theme Template from Data File
How do I tell Shopify to iterate over a custom collection in a Liquid template from a static data file ala Jekyll e.g. to list the names of our stores without mutating the Shopify database (e.g. PUT/POST /admin/pages.json)?
E.g. in Jekyll you can have a folder called
_things with N files like
thing2.json, etc. and loop over these in a template via
for thing in site.data.things ...
Just paste the JSON representing your special data into a file asset, and you can then access and use that file anywhere you want in your Shopify Theme to show off whatever it is that data represents... simple.
Be aware that Shopify is not Jekyll-ish. Never has been. Never will be. Although they do share the fact that they use Liquid to render templates into HTML.
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.