Jun 13, 2011 at 1:09 PM
Edited Jun 13, 2011 at 1:10 PM
The way to do it is reuse the existing "Body Editor" shape - this way your module will even be compatible with other body editor modules (e.g. CKEditor).
If you look at Orchard.Core/Common/Views/EditorTemplates/Parts.Common.Body.cshtml, you'll see this:
@Html.ValidationMessageFor(m => m.Text)
The important bit there is @Display.BodyEditor(Model) - that's actually loading and rendering a
separate template called Body.Editor.cshtml, which there's a default version of in Orchard.Core, but then the TinyMCE module overrides it with its own version, as does the CKEditor module.
The Model type in the above is "BodyEditorViewModel", although you could can also call it like this: