【发布时间】:2019-02-11 07:01:32
【问题描述】:
我想在 theme.liquid 中添加下面提到的代码
<div id="shopify-section-header" class="shopify-
section">
<!-- content of sections/header.liquid -->
<a href="http://pricemonitor.info/cloth_comparision/#/"
class="site-header__icon site-header__imagesearch">
{{ 'imagesearchlogo.svg' | asset_url | img_tag }}
</a>
</div>
我在python中尝试过下面提到的方法
data={
"asset": {
"key": "layout/theme.liquid",
"value": '''<div id="shopify-section-header" class="shopify-
section">
<!-- content of sections/header.liquid -->
<a href="http://pricemonitor.info/cloth_comparision/#/"
class="site-header__icon site-header__imagesearch">
{{ 'imagesearchlogo.svg' | asset_url | img_tag }}
</a>
</div>'''
}
}
response = requests.put("https://" + session.get("shop")
+ "/admin/themes/42517168241/assets.json",data=
data,headers=headers)
我已在 Shopify 应用中添加了此脚本,但没有得到正确的响应
下面是回应。
{
"error": "822: unexpected token at 'asset=key&asset=value'"
}
我无法在theme.liquid 文件中添加这段代码
【问题讨论】:
标签: python shopify liquid shopify-app