在我的液体文件中,我看到很多基于当前模板的条件语句,如下所示:
{% if template contains "product" %}
(do something)
{% endif %}
但是我安装了一个应用程序来创建它自己的页面:
MyStoreName.com/apps/store-locator
- 它不使用模板。
我需要在我的theme.liquid文件中添加一些代码,该文件仅在此应用页面上执行。有没有其他方法来识别页面?
答案 0 :(得分:1)
该页面是否有Shopify可以使用{{ page_title }}
吐出的标题?如果是这样,你应该能够做到
{% if page_title == 'store-locator' %}
{% code goes here %}
{% endif %}