You are here

8 August 2011

How to make enter insert br tag instead of p tag. Works when using WYSIWYG module and ckeditor or tinymce.

Source code viewer
  1. function hook_wysiwyg_editor_settings_alter(&$settings, $context) // replace hook with your module name
  2. {
  3. if($context['profile']->editor == 'ckeditor')
  4. {
  5. $settings['enterMode'] = 2;
  6. $settings['shiftEnterMode'] = 1;
  7. }
  8. elseif($context['profile']->editor == 'tinymce')
  9. {
  10. $settings['forced_root_block'] = FALSE;
  11. $settings['force_br_newlines'] = TRUE;
  12. $settings['force_p_newlines'] = FALSE;
  13. }
  14. }
Programming Language: PHP