I would like to either remove some of the options from the link target select element or specify which options to show. For example, the default has several that I don't need such as frame and popup window.
My question is, how can you specify the link target options or remove certain target options on ckeditor?
Please see screenshot
note that I have already removed the advanced tab using
config.removeDialogTabs = 'link:advanced';
config.removeDialogTabs = 'image:advanced';
I would like to either remove some of the options from the link target select element or specify which options to show. For example, the default has several that I don't need such as frame and popup window.
My question is, how can you specify the link target options or remove certain target options on ckeditor?
Please see screenshot
note that I have already removed the advanced tab using
config.removeDialogTabs = 'link:advanced';
config.removeDialogTabs = 'image:advanced';
Share
Improve this question
asked Oct 18, 2016 at 19:34
droohdrooh
6784 gold badges20 silver badges52 bronze badges
1 Answer
Reset to default 11using the example here.
You can set the items
using this:-
CKEDITOR.on('dialogDefinition', function(ev) {
var dialogName = ev.data.name;
if (dialogName == 'link') {
var dialogDefinition = ev.data.definition;
var informationTab = dialogDefinition.getContents('target');
var targetField = informationTab.get('linkTargetType');
// just <not set> and New Window (_blank)
targetField.items = targetField.items.filter(x => x[1] == '_blank' || x[1] == 'notSet');
}
});