Add components to your storefront theme
This command is available starting sfb-toolkit@5.x.x
.
Using the toolkit
An easy way to add a component to your theme is by executing the following command:
sfb-toolkit components-add
Once the command is executed you will be prompted to provide the following data:
- Name of the new component you wish to add (letters and numbers only).
- On which storefront page (if any) you want the new component to be added to.
- You may choose if the component should be
orderable
(integrated with our Theme Editor) ornon-orderable
(stand-alone).
- You may choose if the component should be
The orderable
option is only available for themes using @appdirect/sfb-theme-components@0.352
or newer.
Orderable components
Orderable components are components that will be added to the theme and are recognized and configurable through our Theme Editor.
Non-orderable components
Orderable components are components that will be added to the theme but are not recognized and configurable through our Theme Editor.
Remove added components
Orderable components
To remove an orderable component you added please follow these steps:
- Delete your added component folder found under:
workspaceFolder/themes/[yourThemeName]/customComponents/components/[addedComponenNamte]
- Open
workspaceFolder/themes/[yourThemeName]/settings.json
- Find the
orderableComponents
list - Remove the object with the
name
attribute matching the component you added
- Find the
- Open
workspaceFolder/themes/[yourThemeName]/customComponents/index.js
- Find and remove the component you added
Non-orderable components
To remove a non-orderable component you added please follow thse steps:
- Delete your added component folder found under:
workspaceFolder/themes/[yourThemeName]/customComponents/components/[addedComponenNamte]
- Open
workspaceFolder/themes/[yourThemeName]/content/pages/[pageYouSlectedToAddComponent]/[pageName].html
- Remove
<component name="yourComponentName" id="yourComponentName"></component>
- Remove
- Open
workspaceFolder/themes/[yourThemeName]/customComponents/index.js
- Find and remove the component you added
Was this page helpful?
Tell us more…
Help us improve our content. Responses are anonymous.
Thanks
We appreciate your feedback!