How can I add an input where a user can add the specific title tag to a link in the ckeditor5? So for example my config file looks like this...
const config = {
toolbar: {
items: [
'bold',
'italic',
'link',
'|',
'bulletedList',
'numberedList',
'|',
'heading',
'|',
'undo',
'redo'
]
},
link: {
addTargetToExternalLinks: true,
decorators: {
openInNewTab: {
mode: 'manual',
label: 'Open in a new tab',
defaultValue: true,
attributes: {
target: '_blank',
rel: 'noopener noreferrer'
}
}, title: {
mode: 'manual',
label: 'Set a title',
defaultValue: ''
}
}
}
}
But I want to add a decorator that is like...
addTitleTag: {
mode: 'manual',
label: 'Add a title tag',
defaultValue: '', // Here the user have an input to add a title text
attributes: {
title: 'value'
}
}
But instead of a checkbox, it's text input. Is this possible?
Unfortunately, this can't be achieved using decorators and is not supported by any means by the original plugin you have to modify the plugin in order to do so. I had the same need and modified the plugin.
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