I'm building a Shopify application and I'm interested in automatically adding a liquid content into the shop's theme.
Asked
Active
Viewed 3,666 times
1 Answers
11
A file with a .liquid extension is considered to be an asset. Since you can add assets to a shop, the answer is yes, you can indeed inject Liquid template code into a shop's theme.
If you use an App Proxy you can also send Shopify Liquid strings and Shopify will render that right in the Shop for you. Pretty neat stuff.

David Lazar
- 10,865
- 3
- 25
- 38
-
Just to make sure I get it right, in order to edit an existing theme's liquid I should receive the required asset, analyze it on my server, and later send a modify/change request for the same liquid with the new edited value? – vovafeldman Dec 18 '12 at 21:15
-
2That is kinda scary. A merchant probably does not want you changing their theme. If they uninstall your App, your edits remain, causing them grief. Much better for you to add your assets as separate assets belonging to your app so that upon uninstalling your App, your code gets nuked too. All you need to do is get them to include your assets in their theme. Some Apps edit and rename theme.liquid to become theme-myapp.liquid to distinguish it from theme.liquid and have the shop owner switch to use your custom theme-myapp.liquid. – David Lazar Dec 18 '12 at 21:45
-
@DavidLazar but many apps are already doing this, I found myself many times with broken templates after an app uninstall – Gabriel Fernandez Jun 30 '22 at 21:48
-
That is why Shopify has moved to ban/kill off all those bad Apps. Developers now use Theme App Extensions, and they eliminate all the bad crap bad App used to litter into old Themes. – David Lazar Jun 30 '22 at 23:23