I enable the "Show blocks" button for CKeditor profiles, 'cause I always find it very useful.

I'd like to enable it on load, by default though. Is it possible?

Thoughts?

Wysiwyg 7.x-2.2+14-dev
CKEditor 4.1.1.5a2a7e3

Thanks

Comments

twod’s picture

Status: Active » Fixed

There is a setting for that called startupOutlineBlocks, but there's currently no widgets in the editor profile GUI to change it.
You can however do this in a small module to set it:

/**
 * Implements hook_wysiwyg_editor_settings_alter().
 */
function MYMODULE_wysiwyg_editor_settings_alter(&$settings, $context) {
  if  ($context['profile']->editor == 'ckeditor') {
    $settings['startupOutlineBlocks'] = TRUE;
  }
}

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

osman’s picture

Thanks TwoD, that's exactly what I needed. Cheers.

karol haltenberger’s picture

Issue summary: View changes

Here's a snippet for Drupal 8.
Pre-selecting the button for all ckeditor enabled formats.

//Pre-select the show blocks button
function HOOK_editor_js_settings_alter(array &$settings) {
  foreach (array_keys($settings['editor']['formats']) as $text_format_id) {
    if ($settings['editor']['formats'][$text_format_id]['editor'] === 'ckeditor') {
      $settings['editor']['formats'][$text_format_id]['editorSettings']['startupOutlineBlocks'] = TRUE;
    }
  }
}
joshuautley’s picture

@TwoD

Super Dope!!! Thank you.