Shopify-修改页面模板&自定义页面的部分参考

发布于 2025-01-24 12:17:07 字数 755 浏览 2 评论 0 原文

我正在尝试在我的Shopify主题中修改特定的路线/模板,但是从我见过的示例或文档似乎所使用的示例中没有什么。

目前,我已经在Shopify Admin团队中创建了一个页面,该页面被自动分配给路由/pags/team-page

在我的模板目录中,我尝试创建不同的变化,以分配一个自定义部分,例如

  • team.json
  • team_page.json
  • page.team.team.json
  • page.team_page.json

和在我的json文件中引用了我的我部分目录液体文件 custy.liquid 带有以下内容:

{
  "sections": {
    "custom": {
      "type": "custom",
      "settings": {}
    },
    "order": [ "custom" ]
}

但是无用,它始终引用模板 index.json.json renders > main.liquid 来自各节。

尝试打印出 page.handle 返回 team-page ,而 page.template_suffx 似乎没有返回。

I am attempting to modify a specific route/template in my Shopify theme, however nothing from examples I have seen or the documentation seems to take.

Currently I have created a page in the Shopify Admin team which is auto assigned to the route /pages/team-page.

In my templates directory I have tried creating different variations as to assign it a custom section such as

  • team.json
  • team_page.json
  • page.team.json
  • page.team_page.json

And within those json files referenced to my sections directory liquid file custom.liquid with the following:

{
  "sections": {
    "custom": {
      "type": "custom",
      "settings": {}
    },
    "order": [ "custom" ]
}

But to no avail it always references back to the template index.json which renders main.liquid from sections.

Attempting to print out the page.handle returns team-page, while page.template_suffx seems to return nothing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文