Getting Started
About Stencil
Transitioning to Stencil
Installing Stencil
Authentication & Tokens
Running Stencil Locally
Advanced Installation Options
Handlebars and Stencil
Handlebars Helpers
Stencil Object Model
Stencil Objects

Components Subdirectory

Components Subdirectory

The /templates/components/ subdirectory contains Handlebars and HTML components (provided as .html files) to create page structure. You can reuse these code snippets and partials throughout your theme.

You can take a look at the Cornerstone components subdirectory and its contents in the Github repository here.

Subdirectories of /templates/components/ group together pages that serve a particular storefront function. For example, here are the .html files contained in the /search/ subdirectory.

Furthermore, the /common/ subdirectory contains forms and icons resources, plus a collection of single-purpose files.

Naming Requirements

Important: Three children of the /templates/components/ subdirectory each contain a set of templates whose file names must remain constant. However, you are free to move each set of template files to other path locations – as long as you keep each set together in one folder and specify the new location. Those folders are note below:

Front-Matter Restrictions

You can use front matter to specify resources only on pages in the /templates/pages/ subdirectory, not on pages here in the /templates/components/ subdirectory.

Please bear in mind that if a front-matter directive contains an invalid option, Stencil CLI will silently ignore that option.