Unique enterMode for each CKEditor toolbar

Bryan Johnson asked on August 18, 2016 19:25

Is it possible to specify a different enterMode for each CKEditor toolbar, instead of the blanket setting for all toolbars found in config.js?

CKEDITOR.editorConfig = function( config ) {
    config.allowedContent = true; // To disable CKEditor ACF
    config.enterMode = CKEDITOR.ENTER_P;
    config.shiftEnterMode = CKEDITOR.ENTER_BR;
    config.entities_latin = false;

I'd like to specify divs for the enterMode of the toolbar_BizForm toolbar, but use paragraph tags for other toolbars.

Recent Answers


Richard Sustek answered on August 19, 2016 08:48

Yes, Kentico has different editor types that you can customize via ckeditors config.js. Specifically you can adjust following toolbars:

  • Full
  • Basic
  • Standard/Default
  • BizForm - used for on-line forms.
  • Forum - used for the editor in forums (if enabled).
  • Newsletter - used for email campaign content.
  • Reporting - used for report content.
  • Invoice - used for invoice content.
  • Group - used for groups.
  • Widgets - used for widgets.

You can find an examples and more information right here.

0 votesVote for this answer Mark as a Correct answer

Bryan Johnson answered on August 19, 2016 17:16

Thank you, Richard. But how would I impart different enter key behavior when the BizForm toolbar is active? I need different enter key behavior for different toolbars. I want to set CKEDITOR.config.enterMode = CKEDITOR.ENTER_DIV for the BizForm toolbar and CKEDITOR.config.enterMode = CKEDITOR.ENTER_P for the other toolbars. The enter mode only appears to be configurable for all toolbars in one place. The toolbar configuration seems to be limited to controlling what buttons appear in the toolbars and does not appear to offer control over the enter key mode. Would I have to implement some javascript to react to when CKEDITOR.config.toolbar changes? Or is there a simpler way?

0 votesVote for this answer Mark as a Correct answer

K Collins answered on September 28, 2016 22:55

Not targeting a specific toolbar set, but we've implemented this for Newsletters - might help point you in the right direction for BizForms:

config.enterMode = location.pathname.indexOf('/Newsletters/Newsletter_Iframe_Edit.aspx') > -1 ? CKEDITOR.ENTER_BR : CKEDITOR.ENTER_P;

Would be nice if there was a way to set the enterMode per toolbar, though.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.