- πΊπΈUnited States bkline Virginia
Our users just asked for this feature. Can you provide a clue as to what that one line of JS would be?
- πΊπΈUnited States hockey2112
I also need a default setting for "open in new window"... in fact, it would be best (at least for me) if I could set that as default for all links and then disallow the end user from modifying that setting.
- πΊπ¦Ukraine dench0
/** * Implements hook_editor_js_settings_alter(). */ function <module_name>_editor_js_settings_alter(array &$settings) { foreach ($settings['editor']['formats'] as &$format) { if (!empty($format['editorSettings']['config']['link']['decorators'])) { foreach ($format['editorSettings']['config']['link']['decorators'] as &$decorator) { $target = $decorator['attributes']['target'] ?? FALSE; if ($target === '_blank') { $decorator['defaultValue'] = TRUE; } } } } }