Download the PHP package bolt/article without Composer
On this page you can find all versions of the php package bolt/article. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package article
Short Description 📝 Bolt Extension to add the Article FieldType
License MIT
Informations about the package article
📝 Bolt Article Extension
This extension provides a "Article" field type, which is a powerful text editor for creating rich content in your Bolt websites. It can work with grids, embeds, typographic markup and media. The editor itself is developed by Imperavi, and is licensed for usage in Bolt.
This extension allows you to add fields of type: article
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:
After installation, you can add it to any ContentType in your
contenttypes.yaml
, like any other field. For example:
The result will be like this:
You can configure the editor in config/extensions/bolt-article.yaml
. This
configuration affects all the instances of the Article field that you've
configured in your ContentTypes. The default configuration looks like this:
Configuring the buttons
Bolt's version of Article ships with all the official plugins and options. you
can add or remove buttons and plugins by configuring them in the plugins:
parameters. Check the official Article 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-article.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:
In bolt-Article.yaml
you can add this as:
Adding custom plugins
If you've written your own block or plugin for Article according to the
documentation for Creating Plugins or
for Creating Blocks, you can add it to the editor in Bolt, by
placing it in /public/assets/article/_plugins
. Then, add it to the
bolt-article.yaml
configuration:
Grid setup
Using Article, you can allow the editors to insert Grid elements, splitting up the "main column" in two or more columns, allowing them more variations for laying out content.
By default, Article has a simple grid that consists of 12 columns, and allows the editors to pick '4 + 4 + 4', '4 + 8', '6 + 6' and '8 + 4' as options. The grid will create HTML like this:
On the front end of the website, this needs to be styled correctly as CSS, in order to work properly. This can be done in a few ways:
- Linking to the default styles.
- Copy the
grid.css
file to your theme to customize it. - Manually styling the grid, using your own CSS.
You can link the grid.css
that ships with Article using the following:
If you prefer to copy the file to your own theme, you can link it using:
Alternatively, if your theme is using Bootstrap or Bulma, you can configure Article to use the grid format from your preferred framework directly. See the documentation on using Bootstrap grid or using Bulma grid.
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:
And then run ECS: