Hack Forums
[PHP] TinyMCE and images - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183)
+---- Thread: [PHP] TinyMCE and images (/showthread.php?tid=5211339)



TinyMCE and images - newQuery - Mar 21, 2016

Hi guys, this thread isn't going to teach you how to code or anything, I just had a problem and just wanted to share it because I think it will be useful.
So, I had a problem with tinymce, I wanted to add a class to all images inserted in the editor to add
Code
class="img-responsive"

All you need to do is to add this to your tinymce:
Code
image_class_list: [
  {title: 'Responsive', value: 'img-responsive'},
  {title: 'None', value: ''}
  ]

Note: I put
Code
{title: 'Responsive', value: 'img-responsive'},
in first so it is set as default.

[Image: d5658ea9d8.png]
[Image: 2996714c97.png]

Ho, and cheers' !