TinyMCE View Template
<script src="@Url.Content("~/Scripts/tinymce/tiny_mce.js")" type="text/javascript"></script>
<script type="text/javascript">
(function () {
tinyMCE.init({
mode: "textareas",
//elements: "engRichMCE,araRichMCE",
elements: "@ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)",
theme: "simple",
height: "300",
width: "400",
verify_html: false,
theme_simple_resizing: true,
content_css: "@Url.Content("~/Content/Site.css")",
convert_urls: false
})
})();
</script>
@Html.TextArea(string.Empty, /* Name suffix */
ViewData.TemplateInfo.FormattedModelValue /* Initial value */
)
Model
[UIHint("tinymce_full_compressed"), AllowHtml]
public string eng_html { get; set; }
[UIHint("tinymce_full_compressed"), AllowHtml]
public string ara_html { get; set; }
View
@Html.EditorFor(model => model.eng_html, new { id = "engRichMCE" })
@Html.ValidationMessageFor(model => model.eng_html)
@Html.EditorFor(model => model.ara_html, new { id = "araRichMCE" })
@Html.ValidationMessageFor(model => model.ara_html)
The Problem is only one instance of tinyMCE is loading in my view, i need both fields to get tinyMCE editor, any advice ?
Update
What i've done so far, looking at tinyMCE documentations,
http://www.tinymce.com/wiki.php/Configuration3x:mode
mode value can be exact, textareas or specific_textareas. If set mode="textarea" in the init function, all textareas are converted to tinMCE...which is not what i need.
Also duplicating the partial view that holds the tinyMCE didn't work.
using mode="exact" and elements="araRichMCE,engRichMCE" in tinyMCE init function and adding IDs in my view did not work either ?
tinymceyou'll find some context for that error I'm guessing. For me personally to help you're going to have to get me a lot more context about that error. Some others here may know the JS for that control better. - Mike Perrenoud