I see the following code in the fckconfig.js:

FCKConfig.EnterMode = 'br' ; // p | div | br
FCKConfig.ShiftEnterMode = 'br' ; // p | div | br

I want to change the EnterMode to use br tags vs. p. As shown above. When I make this tweak and then use the editor in my site it's still entering p tags. This used to be a configuration you could change in the Drupal FCKEDitor settings in the older version of FCKEditor module. How does one make this tweak work with the WYSIWYG API module?

-backdrifting

Comments

twod’s picture

Status: Closed (fixed) » Fixed

We'll have a GUI for this when #313497: Allow configuration of advanced editor settings gets fixed.
Until then, you can use an implementation of hook_wysiwyg_editor_settings_alter() to override these settings in a small module of your own.
Otherwise, the settings made in the config file are overridden by Wysiwyg module. (In the end, we want to avoid having to modify files when setting up editors.)

There are some examples of using the hook in the issue mentioned above, and some more in the issue queue.

Something like this should work (where 'custom' is your module name):

function custom_wysiwyg_editor_settings_alter(&$settings, $context) {
  if($context['profile']->editor == 'fckeditor') {
    $settings['EnterMode'] = 'br';
    $settings['ShiftEnterMode'] = 'br';
  }
}

EDIT: Fixed typo.

Status: Active » Closed (fixed)

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

Nick Robillard’s picture

Fyi, for FCKeditor, the settings keys need to be capitalized.

$settings['EnterMode'] rather than $settings['enterMode'] (will not work!)

Status: Fixed » Closed (fixed)

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