Theme Development Best Practices

I am working on a theme based on the CS Cart Boilerplate available on github. Here is what I have done so far:

- cloned it to design/themes/boilerplate

- copied that theme to design/themes/company

- modified its manifest.json

As I understand it, if you upgrade a site, files in design/themes get overwritten if there are more up to date files, and the only way to avoid this behavior is to work with the hooks structure and by using overrides if necessary.

This work should happen in an addons folder within your theme, so for example `design/themes/my_theme/addons/my_addon/` should hold your divergences from the stock theme.

However the boilerplate theme is based on a 12-unit grid, using standard bootstrap classes, we want to use a 16 column grid. So most `class=` declarations are going to have to be replaced in our case.

Is there documentation on how file replacement on upgrade occurs?

I am working on a theme based on the CS Cart Boilerplate available on github. Here is what I have done so far:

- cloned it to design/themes/boilerplate

- copied that theme to design/themes/company

- modified its manifest.json

As I understand it, if you upgrade a site, files in design/themes get overwritten if there are more up to date files, and the only way to avoid this behavior is to work with the hooks structure and by using overrides if necessary.

This work should happen in an addons folder within your theme, so for example `design/themes/my_theme/addons/my_addon/` should hold your divergences from the stock theme.

However the boilerplate theme is based on a 12-unit grid, using standard bootstrap classes, we want to use a 16 column grid. So most `class=` declarations are going to have to be replaced in our case.

Is there documentation on how file replacement on upgrade occurs?

Boilerplace won't be updated during upgrade process because it does not have "parent_id" in manifest.json.

So you can work safely in your clonned theme.

Addons with templates overrides are used mostly by theme developers.

You will get you theme files overridden in one of the following cases:

- you use basic or responsive theme

- you use custom theme which has parent_id parameter equal to "responsive" in manifest.json (mostly such themes are cloned from responsive)

Right now we are working on changes in the process of upgrading themes, but these changes will affect only themes that depend on responsive.