skip to Main Content

Newbie here. I’m trying to create a custom template for a subcategory. I’m working locally using the stencil cli and Visual Studio Code. I created the following:


templates/pages/custom/category/_category-3d-series.html.

Then I updated config.stencil.json, the following code, setting the category to match my store’s URL:

"customLayouts": "category": "_category-3d-series.html":"/3d-series/"

Then I run stencil start in PowerShell, but when I check my site locally, it’s not using the custom page I created, I can tell because I put "this is my 3D category!" in the .html file. And I cannot figure out why.

2

Answers


  1. Chosen as BEST ANSWER
    {
    "customLayouts": {
    "category": {
    "_category-3d-series.html": ["/3d-series/"]
    }
    }
    

  2. You don’t have proper JSON syntax. (Specifically, you’re missing { and } characters in multiple places.)

    {
      "customLayouts": {
        "category": {"_category-3d-series.html":"/3d-series/"},
      }
    }

    I haven’t seen a template name prefixed with an underscore before, though I don’t have any reason to think that would cause a problem.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search