bolt / redactor
📝 Bolt Extension to add the Redactor FieldType
Installs: 117 039
Dependents: 1
Suggesters: 0
Security: 0
Stars: 11
Watchers: 10
Forks: 12
Open Issues: 3
Language:JavaScript
Type:bolt-extension
Requires
- php: >=7.2.9
Requires (Dev)
- bolt/core: ^5.0
- symplify/easy-coding-standard: ^7.0
- dev-master
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.0
- 1.0.34
- 1.0.33
- 1.0.32
- 1.0.31
- 1.0.30
- 1.0.29
- 1.0.28
- 1.0.27
- 1.0.26
- 1.0.25
- 1.0.24
- 1.0.23
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.0.1
This package is auto-updated.
Last update: 2024-12-09 17:22:08 UTC
README
This extension provides a "Redactor" field type, which is a sophisticated, lightweight and elegant WYSIWYG editor component for Bolt. The editor itself is developed by Imperavi, and is licensed for usage in Bolt.
This extension allows you to add fields of type: redactor
in your
ContentTypes, as defined in contenttypes.yaml
, like any other Field type.
Installation
Note: Installation is not required if you've installed the default Bolt project. In that case it's already present. If you've installed Bolt through different means, you'll need to run the command below:
composer require bolt/redactor
After installation, you can add it to any ContentType in your
contenttypes.yaml
, like any other field. For example:
blogposts: name: Blogposts singular_name: Blogpost fields: title: type: text slug: type: slug uses: title content: type: redactor
The result will be like this:
You can configure the editor in config/extensions/bolt-redactor.yaml
. This
configuration affects all the instances of the Redactor field that you've
configured in your ContentTypes. The default configuration looks like this:
default: buttons: [ bold, italic, format, lists, link, html, image ] plugins: [ fullscreen, table, inlinestyle, video, widget ] source: true plugins: ~
Configuring the buttons
Bolt's version of Redactor ships with all the official plugins and options. you
can add or remove buttons by configuring them in the buttons:
and plugins:
parameters. Check the official Redactor documentation for all available
buttons. Note that some buttons might require you to enable the
corresponding plugin as well. See here for a list of
the available plugins.
Settings
Where applicable, you can add extra settings under the default:
key in the
bolt-redactor.yaml
configuration. See the documentation for available
settings.
Note that this documentation uses Javascript, whilst Bolt's configuration uses Yaml. For example, the documentation for 'Paste' has this example:
$R('#content', { pastePlainText: true });
In bolt-redactor.yaml
you can add this as:
default: buttons: [ …] plugins: [ … ] pastePlainText: true
Adding custom plugins
If you've written your own plugin for Redactor according to the documentation
for Creating Plugins, you can add it to the editor in Bolt, by
placing it in /public/assets/redactor/plugins
. Then, add it to the
bolt-redactor.yaml
configuration:
default: buttons: [ … ] plugins: [ … ] plugins: myplugin: [ 'myplugin/myplugin.js', 'myplugin/myplugin.css' ]
The part below is only for developing the extension. Not required for general usage of the extension in your Bolt Project
Running PHPStan and Easy Codings Standard
First, make sure dependencies are installed:
COMPOSER_MEMORY_LIMIT=-1 composer update
And then run ECS:
vendor/bin/ecs check src --fix