@kitconcept/volto-separator-block
v4.1.1
Published
volto-separator-block: Volto add-on that provides a visual separator between blocks
Downloads
1,446
Readme
Volto Separator Block
The Volto Separator Block allows editors to add a visual separator between blocks to a Volto page.
Screenshot
Screencast
Installation
Create a new Volto project (you can skip this step if you already have one):
npm install -g yo @plone/generator-volto
yo @plone/volto my-volto-project --addon @kitconcept/volto-separator-block
cd my-volto-project
Add @kitconcept/volto-separator-block
to your package.json:
"addons": [
"@kitconcept/volto-separator-block"
],
"dependencies": {
"@kitconcept/volto-separator-block": "*"
}
Download and install the new add-on by running:
yarn install
Start Volto with:
yarn start
Go to http://localhost:3000, login, create a new page. The separator block will show up in the Volto blocks chooser.
Block Alignment Enhancer
This block features by default a block schemaEnhancer
that provides an alignment option for the separator. This can be disabled by overwriting with your own schemaEnhancer
config.blocks.blocksConfig.separator = {
...config.blocks.blocksConfig.separator,
schemaEnhancer: mySeparatorSchemaEnhancer,
}
or setting it to null
or undefined
:
config.blocks.blocksConfig.separator = {
...config.blocks.blocksConfig.separator,
schemaEnhancer: null,
}
Also, if you want to keep the default alignment but still add your own schemaEnhancer
you can compose it along with your own:
import { composeSchema } from '@plone/volto/helpers';
import { SeparatorStyleEnhancer } from '@kitconcept/volto-separator-block';
config.blocks.blocksConfig.separator = {
...config.blocks.blocksConfig.separator,
schemaEnhancer: composeSchema(mySeparatorSchemaEnhancer, defaultSeparatorEnhancer),
}
Credits
The development of this plugin has been kindly sponsored by Forschungszentrum Jülich.
License
The project is licensed under the MIT license.