CKEditor Line Height

Component ID

2917355

Component name

CKEditor Line Height

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

311

Component created

Component changed

Component body

Introduction

Integrates CKEditor's Line Height plugin to Drupal's CKEditor implementation adding a new dropdown button to modify the line height of your content using inline style.

Requirements

CKEditor Module (Core)

Installation

  1. Download the CKEditor plugin from here and place it in <Drupal root>/libraries/ckeditor/plugins
  2. Download the module
  3. Enable it
  4. Configure the CKEditor toolbar to include the dropdown button


The line heights are predefined, however, you can easily change that setting by implementing hook_editor_js_settings_alter for each format like so:

/**
 * Implements hook_editor_js_settings_alter().
 */
function HOOK_editor_js_settings_alter(array &$settings) {
  $settings['editor']['formats']['full_html']['editorSettings']['line_height'] = '10px;22px';
}

Above I'm setting the 'full_html' format to have only the 10px and 22px line height options.
Please note that you can change the measuring unit from px to em for example.