Drupal - How to set target="_blank" for links in CKEditor
D8 Editor Advanced link module
Enhances the link Dialog in D8 CKEditor. Allows to define the following attributes:
- title
- class
- id target
- rel
You can use the Linkit module and add a "target" attribute at admin/config/content/linkit/manage/default/attributes/add
It has two options:
- Selectlist with predefined targets.
- Simple checkbox to allow links to be opened in a new browser window or tab.
If you want every link to open in a new window, it'd be better to not use the Editor Advanced Link module, but instead add a filter to your text format that sets target=_blank
on every <a>
.