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';
using 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');
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With