Skip to main content

Install Blk42 plugin for CKEditor 5

Blk42 adds Bootstrap and Tailwind grids to your CKEditor 5: insert a block with the grid layout you pick, edit the grid, fill the block with content and save it as a template for later.

  • Install NPM package​

    Blk42 is part of the N1ED plugin for CKEditor 5, one npm package that is easy to add into your existing CKEditor 5 build project for further compilation. Your Blk42 API key switches on the blocks. If you buy N1ED later, its file manager and image editor join the same build with no rebuild.

    npm install --save-dev @edsdk/n1ed-ckeditor5

    Moving from @edsdk/blk42-ckeditor5? Replace it, don't add to it: remove its import and the Blk42 entry from plugins. An old version left in the build next to N1ED stops CKEditor 5 before it starts (two plugins named Blk42).

  • Include to build​

    Add N1ED into your import section:

    import {
    ClassicEditor,
    Image,
    Essentials,
    Paragraph,
    Bold,
    Italic
    } from 'ckeditor5';
    import N1ED from "@edsdk/n1ed-ckeditor5";

    Then pass it to the plugins section of your ClassicEditor creation method call and set the API key:

    ClassicEditor.create(
    document.querySelector('#editor'), // your editor selector
    {
    licenseKey: "GPL", // or your commercial key: CKEditor 5 v44+ will not start without one
    plugins: [
    Essentials,
    Paragraph,
    Bold,
    Italic,
    N1ED
    ],
    apiKey: "BL42B5RRdemodemodemodemo", // the demo key; yours is in the Dashboard: https://blk42.com/dashboard
    }
    ).then( editor => {
    console.log(editor);
    } ).catch( error => {
    console.error(error.stack);
    } );
  • Build​

    Build your CKEditor 5 project or your project with CKEditor 5 imported to apply the newly added plugin.

    If you see a new bottom toolbar of the editor, everything works fine.

  • Ready to Use

Configuration​

Configure your Blk42 CKEditor 5 installation in the Dashboard: set the Bootstrap or Tailwind options and share your custom blocks between your websites, all without touching the code.

Blk42 uses the editor's own image upload settings. For blocks together with a file manager and an image editor in one plugin, use N1ED.

Dashboard

Examples​

Live CodePlay examples for CKEditor 5 with the JS/CSS/HTML code provided.