Boilerplate project for creating Studio Digital Editor component sets.
This section describes how to set up, develop and package component sets out of the boilerplate.
Important: use a release of the boilerplate that is supported by the target Studio application. See the Releases page for an overview.
Download, clone or fork this repository from the desired release tag.
NodeJS 16 and NPM 8: Node
Consider using NVM to manage multiple versions of NodeJS and NPM, as sometimes projects may require different versions:
Run in the folder where this README is located:
npm installFollow the instructions listed in the Setup section and then, in the new folder, run:
npm run devThis will watch for any changes in the component-sets folder and run the validation logic. Watch mode does not rebuild vendor.js and design.css.
Please see the Documentation Components Model for more details on the expected structure of a component set.
To create a component set ready for usage, run:
npm run buildThis will validate the set and create a zip in the dist folder, which you can upload through the Studio Management Console.
This quick guide shows the steps to create a new custom component based on the body component
- Copy
component-sets/default-components/styles/_body.scsstocomponent-sets/default-components/styles/_my_component.scss- Edit the
scssand change.bodyto.my_component
- Edit the
- Edit
_my_component.scssto make changes to the default style of your component - Copy
component-sets/default-components/templates/html/body.htmltocomponent-sets/default-components/templates/html/my_component.html- Edit the html and change the class name
bodytomy_component
- Edit the html and change the class name
- Edit
component-sets/default-components/components-definition.jsonto define the new component- Copy & Paste the body component definition into the components section
- Change the name to
my_component - Change the label to
"my_component". - Scroll to the Groups section and add
my_componentto one of the groups, for example the text group
- Run
npm run buildfrom the main dir to build your component set - Upload the component set zip file found in the
distfolder using the Component sets page in the the Studio Management Console. The Console can be found in the Integrations section of the Studio server admin pages - Create a new Digital Article template in Studio and select your component set in the create dialog
- Create a new Digital Article from the template
- Add your component using the
+button
To create a new stable release:
- Update version in package.json & run
npm install - Create Pull Request and merge to master
- Create a new GitHub release