I’m having a hard time figuring out how to add an option to the toolbar that I can click to add a class to an image (class=”img-fluid”). I’d be happy with either a predefined button in the “Styles” drop down, or even a button on the image toolbar (either to type or a pre-defined button. I have tried 100 different ways, and I can’t seem to get any to work. Also, is there a way to automatically insert a class on an image that is uploaded (ie through ckfinder). Any help would be greatly appreciated. Thanks!
I tried adding this to the style definitions, but it appears under Blockquote, and it’s greyed out when I click on the image.
{
name: ‘Responsive Img’,
element: ‘img’,
classes: [‘img-fluid’]
}
I also tried adding ‘ImageStyle:class’ or className, to the toolbar, but that didn’t work either.
image: {
toolbar: [
‘toggleImageCaption’,
‘imageTextAlternative’,
‘|’,
‘imageStyle:inline’,
‘imageStyle:wrapText’,
‘imageStyle:breakText’,
‘imageStyle:class’,
‘|’,
‘resizeImage’
]
},