ima9ines wrote:Hi,
Following are steps to enable text color plugin for nopCommerce 3.40 editor (TinyMCE):
- Open the "Nop.Admin/Views/Shared/EditorTemplates/RichEditor.cshtml" file.
................
tinyMCE.init({
selector: "#@ViewData.TemplateInfo.GetFullHtmlFieldId(string.Empty)",
fontsize_formats: "8pt 9pt 10pt 11pt 12pt 26pt 36pt",
height: 350,
width: 790,
plugins: [
"advlist autolink lists link image charmap print preview anchor textcolor",
"searchreplace visualblocks code fullscreen",
"insertdatetime media table contextmenu paste@(allowJbimages ? " jbimages" : null)",
],
toolbar: "insertfile undo redo | styleselect | fontselect | fontsizeselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image@(allowJbimages ? " jbimages" : null) | forecolor backcolor",
//"relative_urls" required by jbimages plugin to be set to "false"
relative_urls: false,
@if (allowRoxyFileman){
<text>
//picture manager
file_browser_callback: RoxyFileBrowser@(random),
</text>
}
//we should set "convert_urls" set to "false" (because of "relative_urls" requirement)
//otherwise, it'll break existing links when editing message template
convert_urls: false
});
---------------------------------------------------------
Hello-
I am trying to modify the init of my TinyMCE and running into a problem which I'm hoping you can help me solve.
I am defining the schema as HTML5, and including extended valid elements so that TinyMCE does not strip my microdata from content when switching between views.
http://www.tinymce.com/wiki.php/Configuration:schemahttp://www.tinymce.com/wiki.php/Configuration:valid_elements-----------------------------------------------------------
tinyMCE.init({
schema: "html5",
extended_valid_elements:"@[itemscope|itemtype|itemid|itemprop|itemref|content],div,span,meta,time[datetime]",
selector: "#@ViewData.TemplateInfo.GetFullHtmlFieldId(string.Empty)",
fontsize_formats: "8pt 9pt 10pt 11pt 12pt 26pt 36pt",
height: 350,
width: 790,
plugins: [
"advlist autolink lists link image charmap print preview anchor",
"searchreplace visualblocks code fullscreen",
"insertdatetime media table contextmenu paste@(allowJbimages ? " jbimages" : null)"
],
toolbar: "insertfile undo redo | styleselect | fontselect | fontsizeselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image@(allowJbimages ? " jbimages" : null)",
//"relative_urls" required by jbimages plugin to be set to "false"
relative_urls: false,
@if (allowRoxyFileman){
<text>
//picture manager
file_browser_callback: RoxyFileBrowser@(random),
</text>
}
//we should set "convert_urls" set to "false" (because of "relative_urls" requirement)
//otherwise, it'll break existing links when editing message template
convert_urls: false
});
------------------------------------------------------------------------------------------
But this throws an error when I try to edit a topic page or other content using TinyMCE:
error in log says:
"[" is not valid at the start of a code block. Only identifiers, keywords, comments, "(" and "{" are valid.
I think it refers to this:
@
[itemscope
I am guessing that the "@" causes .NET to think there is a new code block.
The documentation at TinyMCE explains that the @ symbol is used as a keyword to indicate "all" elements.
Can you suggest another way to write the extended valid elements so that there are no errors with .NET?
Can the @ somehow be "escaped" ?
Thanks,
Steve