Trying to set the same as described under https://www.drupal.org/node/1313162 in TinyMCE (what a great functionality!!).

My users are not so IT handy, and explaining that they have to insert external links using target=_blank is easily forgotten.

How to default to target=_blank please?

Comments

TwoD’s picture

Status: Active » Fixed

It does not look like there's a way to set the default target, but maybe TinyMCE will default to the one first in the list if we override it. Either way, if we set only one option, I would think it'd default to that.
Here's how to override the target list:

  function MYMODULE_wysiwyg_editor_settings_alter(&$settings, $context) {
  if($context['profile']->editor == 'tinymce') {
      $settings['target_list'] = array(
         array('title' => t('New window'), 'value' => '_blank'),
         array('title' => t('Same window'), 'value' => '_self'),
      );
  }
}
jandewit6’s picture

Status: Fixed » Closed (fixed)

Thank you, workable solution.