Skip to content

Instantly share code, notes, and snippets.

@kae76
Last active August 29, 2015 14:07
Show Gist options
  • Save kae76/37a070c613450b0392f4 to your computer and use it in GitHub Desktop.
Save kae76/37a070c613450b0392f4 to your computer and use it in GitHub Desktop.
Created a custom module: A simple fix for WYSIWYG making the configuration site wide. This fulfilled the initial user story requirements.
<?php
/**
* @file custom.module
* Drupal site build.
*/
/**
* Implements hook_wysiwyg_editor_settings_alter().
*/
function wo_custom_wysiwyg_editor_settings_alter(&$settings, $context) {
// Ckeditor specific
if ($context['profile']->editor == 'ckeditor') {
// Remove formatting from pasting.
$settings['forcePasteAsPlainText'] = '1';
// Remove any tool bar customisation to set up our own.
unset($settings['toolbar']);
$settings['toolbar'][] = array(
'Bold',
'Italic',
'BulletedList',
'NumberedList',
'Scayt',
'Link',
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment