Creating a custom page template in stencil for bigcommerce

余生长醉 提交于 2019-12-14 02:09:52

问题


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.


回答1:


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.

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": {}
 }

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.

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.




回答2:


Currently, you cannot set custom templates. This is on the roadmap and would be facilitated through the control panel.




回答3:


This feature is no longer in beta. It is live the correct path for the custom templates for a custom page is templates\pages\custom\page

Upload a file like custompagetemplate.html into this folder.

There was an issue with manifest.json causing this feature not to work. Once this file was removed it was live and active on Bigcommerce.



来源:https://stackoverflow.com/questions/36024403/creating-a-custom-page-template-in-stencil-for-bigcommerce

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!