API Template

Highlighted
New Member
5 0 0

Hi,

 

I am looking into developing my first Shopify App. I have a question based around the templating for the storefront. I have read up on the Sections & Assets API etc however I cant find an answer to my question.

 

I have noticed you can add snippets or sections for the new them architecture within the partner app admin area but I don't think this will help me.

 

Say I wanted to overwrite the collection.liquid page template itself could I do this. For instance this would be the flow:

  • User installs app
  • The collection.liquid file gets backed up and a new version gets created that calls a custom section

This would allow me to create a custom collection page with a custom listing area, toolbar and filters for example. or if there is a better way to do this could someone point me in the right direction.

 

Thanks.

Matt.

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 102 129

Hi @MattMent ,

 

The Shopify Asset API should accomplish everything you are looking to do here: https://shopify.dev/docs/admin-api/rest/reference/online-store/asset?api[version]=2020-04

 

Here is a helpful post that details how you could use the Asset API to get a Liquid file, save it, and then update it to include any custom content you want: https://stackoverflow.com/questions/30883360/modify-theme-liquid-using-shopify-api

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
New Member
5 0 0

Hi @hassain 

 

Thats perfect Ill do a bit more reading up on the Asset API.

 

Thanks.

Matt.

0 Likes