在模板中为Bigcommerce创建自定义页面模板 [英] Creating a custom page template in stencil for bigcommerce

查看:220
本文介绍了在模板中为Bigcommerce创建自定义页面模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在本地安装了模具及其所有依赖项,并且能够创建几个自定义组件,但是我不知道如何在bigcommerce中为自定义网页"设置自定义模板.在/templates/pages/中创建自定义页面模板(custom-page.html)的问题,但这似乎并没有解决它.在旧版中,您可以从下拉菜单中选择页面模板.首先要通过webDAV上载主题吗?是否需要JS模块或config.JSON设置来注册模板?任何帮助将不胜感激.

I've installed stencil and all its dependencies locally and was able to create a couple custom component but I can't figure out how to set a custom template for a custom "webpage" in bigcommerce.I thought it would be a matter of creating a custom page template (custom-page.html) in /templates/pages/ but that doesn't seem to hook it up. In the legacy version, you were able to select a page template from a dropdown. Is it a matter of uploading the theme via webDAV first? Is there a JS module required or config.JSON setting to register a template? Any help would be much appreciated.

推荐答案

要为网页创建自定义模板,您需要将文件(例如,已创建的_custom-page.html)放置在template/pages/custom/pages目录中

To create custom template for webpage you need to place the file(e.g _custom-page.html that you have created) in template/pages/custom/pages directory.

要在本地进行测试,您需要将自定义模板分配给.stencil文件中的url.例如,

To test it locally, you need to assign the custom template to the url in .stencil file. For example,

"customLayouts": {

"products": {},
"pages": {"_custom-page.html":"/{you-webpage-url}/"},
"brands": {},
"categories": {}
 }

当前,此功能处于beta状态,因此您无法在bigcommerce服务器中将自定义模板分配给所需的网页url.但是,您可以通过请求bigcommerce客户服务为您的网站启用此功能,并接受其不支持许多功能的beta版条件来做到这一点.

Currently, this feature is in beta and so you cannot assign the custom template to the desired webpage url in bigcommerce server. However you can do so by requesting bigcommerce customer service to enable this feature for your site and by accepting their condition for beta not supporting many features.

注意:自定义模板名称应以_(下划线)开头.检查我是否将您的文件名custom-page.html更改为_custom-page.html.另外,由于您已经为网页创建了自定义模板,因此我也已将_custom-page.html分配到pages目录.

Note: Custom template name should start with _(underscore). Check I have changed your file name custom-page.html to _custom-page.html. Also I have assigned the _custom-page.html to pages directory, since you have created custom template for webpage.

这篇关于在模板中为Bigcommerce创建自定义页面模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆