Block ID

Adds a block control button for setting the HTML id attribute on the current block. Useful for anchor links and targeted CSS.

Select a block, open the control dropdown, and choose Block ID. Enter a unique id and save.

Load the bundle

<script src="/assets/redactor/redactor.js"></script>
<script src="/assets/redactor/plugins/block-id/block-id.js"></script>

Initialization

const app = Redactor('#entry', {
    plugins: ['blockId']
});

Options

  • icon (string)
    • SVG icon HTML for the block control button.
Redactor('#entry', {
    plugins: ['blockId'],
    blockId: {
        icon: '<svg...>'
    }
});

Language strings

en: {
    blockId: {
        'block-id': 'Block ID',
        'id': 'ID'
    }
}

Events

This plugin does not emit events.

API

This plugin does not expose a public API.