Add TinyMce to Custom Content Part

Topics: Customizing Orchard
Oct 18, 2014 at 1:32 AM
I have a custom content part that I've created that has a title and a message. I would like the message editor to be a text area that utilizes TinyMce just as the BodyPart does but I'm clueless as how to get started. I've been looking at the BodyPart's view files and driver.cs file but can't figure out how TinyMce is getting implemented. My message text is currently set up as a text area I just need to get TinyMce in it somehow. Thanks.
Developer
Oct 18, 2014 at 2:11 AM
Edited Oct 18, 2014 at 2:11 AM
The easiest way is to implement your Message field using a TextField - then it's a simple matter of configuring that field to use the "html" flavor.

If you must implement TinyMce for your part without using the TextField, then you might want to consider implementing it using the same flavor system, so you can change flavors if you wanted to. If you don't want to support other flavors, simply referencing the TinyMce scripts (and possibly styles) should do it - the TinyMce module shows you exactly how to do it if you open the Body-Html.Editor.cshtml file.
Marked as answer by emeraldarcher on 10/17/2014 at 7:40 PM
Oct 18, 2014 at 3:40 AM
Thank you sfmskywalker. I was able to get TinyMce implemented in my content part by referencing OrchardTinyMce.js and including a couple styles in my textarea. I haven't implemented the flavors yet, that will have to come later.