I uploaded a new template, let's call it my-template, using stencil tool. The template file is placed in folder pages/custom/page/my-template. I can select the template in the Template dropdown section on admin page, so I assumed the template is uploaded successfully.
The problem is that, when I preview this page, the template is applied, but on my local, the custom template is not applied (instead, it uses the default page template). Is there any step or any setting missing here? What can I do to work with my-template on localhost?
When you're working locally, your .stencil file controls the mapping between custom templates and the pages they should be assigned to. Here's an example that would apply the custom my-template file to a webpage whose URL is /about-us/ :
{
"normalStoreUrl": "http://mystore.mybigcommerce.com",
"port": 3000,
"clientId": "xxxxxxxxxxxxxxxxx",
"accessToken": "xxxxxxxxxxxxxxxxxx",
"customLayouts": {
"brand": {},
"category": {},
"page": {
"my-template.html": "/about-us/"
},
"product": {}
}
}
Note: After you edit your .stencil file, you'll want to re-start the CLI to see your changes applied
https://developer.bigcommerce.com/stencil-docs/template-files/custom-templates/authoring-testing-uploading-custom-templates#authoring-testing-uploading_local-mapping
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With