Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bigcommerce template is not applied on localhost

Tags:

bigcommerce

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?

like image 408
Tyler Bean Avatar asked May 27 '26 14:05

Tyler Bean


1 Answers

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

like image 52
Karen White Avatar answered Jun 04 '26 17:06

Karen White