如何识别没有模板的Shopify App页面

时间:2015-11-10 15:04:45

标签: shopify liquid

在我的液体文件中,我看到很多基于当前模板的条件语句,如下所示:

{% if template contains "product" %}
  (do something)
{% endif %}

但是我安装了一个应用程序来创建它自己的页面:

MyStoreName.com/apps/store-locator

- 它不使用模板。

我需要在我的theme.liquid文件中添加一些代码,该文件仅在此应用页面上执行。有没有其他方法来识别页面?

1 个答案:

答案 0 :(得分:1)

该页面是否有Shopify可以使用{{ page_title }}吐出的标题?如果是这样,你应该能够做到

{% if page_title == 'store-locator' %}
    {% code goes here %}
{% endif %}