newbthenewbd / grav-plugin-tinymce-editor

TinyMCE Editor Integration Plugin for Grav
Other
60 stars 10 forks source link

How to add image_class_list #17

Closed anjoclaudio closed 6 years ago

anjoclaudio commented 6 years ago

Hi I want users to be able to chose a predefined image class set in a css file. Is it possible to do this by adding an image_class_list to the parmeters in tinymce-editor.yaml. If so how can I do this?

Thanks Claudio

newbthenewbd commented 6 years ago

Indeed, properly setting image_class_list doesn't seem to be possible right now, as neither TinyMCE nor the integration plugin is trying to use JSON.parse() on the supplied string, contrary to how I'd interpret the documentation. I'll try to fix this ASAP.

Thanks for reporting!

newbthenewbd commented 6 years ago

Hopefully fixed in v1.1.8. You should now be able to set image_class_list under parameters, like this:

parameters:
  -
    name: fontsize_formats
    value: '6pt 7pt 8pt 9pt 10pt 11pt 12pt 13pt 14pt 15pt 16pt 18pt 20pt 22pt 24pt 26pt 28pt 32pt 36pt 40pt 44pt 48pt 54pt 60pt 66pt 72pt 80pt 88pt 96pt'
  -
    name: paste_data_images
    value: '1'
  -
    name: image_class_list
    value: '[{"title":"test","value":"class"}]'