问题
I need to inject liquid markup to the store's theme templates when my app is installed. I know there are ScriptTags, but they load scripts. And I know that the scripts can change the page's DOM. but I need to install my liquid to the product details pages. is it possible?
回答1:
I would add your Liquid as a new snippet asset. The merchant can then be instructed to paste a Liquid include statement you provide them in their product Liquid scripts.
That is fairly clean. Otherwise, your App could download their product Liquid script, edit it, and then add it to the shop as an alternative template. You could then instruct the merchant to render their products with the alternative template.
I am sure there are other possibilities too.
来源:https://stackoverflow.com/questions/12265070/how-can-my-app-modify-the-shops-template-files