Try our conversational search powered by Generative AI!

Anyone built an Insert div plugin for TinyMCE?


In my TinyMCE editor I need to be able to wrap some some content in a div block and add a style to it. I first had a look at the Insert Layour toolbar option that already exists but this copies your selection to the end of the editor and inserts a div with inline styles, so in my case an editor would have to go into the html view and remove the styles so they may as well add the div manually.

I found someone who has built a plugin like this ( and I managed to implement it but it is a little buggy especially when trying to wrap around things like an unordered list. It is okay but not ideal.

Further down that same forum topic they mention the ability to apply formats within version 3.3. I haven't been able to determine what version TinyMCE we are running and attempts to create a plugin using this method have failed.

Has anyone else tried to do this and managed to get it working and stable?

Aug 12, 2011 0:34

This isn't really what you're asking for, but one idea might be to use Dynamic Content to allow your editors to add a div with a specified style.  I long ago gave up trying to pound TinyMCE into submission when trying to include things like YouTube videos, so I simply made a Dynamic Content widget that allows editors to add whatever code they like, and as it's Dynamic Content, TinyMCE won't rewrite the code.

Just an idea.

Aug 17, 2011 4:48
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.