tinyMCE configuration

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 anos atrás
I need to make changes to the default nopComm tinyMCE configuration.  I am struggling to find where the initialization is being called from.  Does anyone know?

-christopher
12 anos atrás
Try here:

Administration/Views/Shared/EditorTemplates/RichEditor.cshtml
12 anos atrás
Wonderfull! this is it.

Thanks,

-christopher
11 anos atrás
Does anybody knows how to configure tinymce to allow style tag.
Actually when I start html with this :


<style type="text/css"> table, tr, td, p { color: #5C5B5B; font-family : 'Century Gothic',Arial,sans-serif; font-size: 14px} table { table-layout:fixed; } </style>
<table border="0" cellpadding="0" cellspacing="0" height="100%" style="background-color: #F4F4F4; width: 100%; height : 100%" width="100%">
  <tr>...


tinymce removes the style tag :(
I tried to add
valid_children: "+body[style]",
valid_elements: "*[*]"

in tinyMCE.init() but it does not work

Any idea?

ps : I already know it's not very nice to do this, but this trick is sometime necessary in emails templates ;)
6 anos atrás
nicolas.muniere wrote:
Does anybody knows how to configure tinymce to allow style tag.
Actually when I start html with this :


<style type="text/css"> table, tr, td, p { color: #5C5B5B; font-family : 'Century Gothic',Arial,sans-serif; font-size: 14px} table { table-layout:fixed; } </style>
<table border="0" cellpadding="0" cellspacing="0" height="100%" style="background-color: #F4F4F4; width: 100%; height : 100%" width="100%">
  <tr>...


tinymce removes the style tag :(
I tried to add
valid_children: "+body[style]",
valid_elements: "*[*]"

in tinyMCE.init() but it does not work

Any idea?

ps : I already know it's not very nice to do this, but this trick is sometime necessary in emails templates ;)


FYI, I am running into the same challenge and have tried adding:

valid_children: "+body[style]",
valid_elements: "*[*]"


to no avail. We need to customize certain pages with different styling and so need a solution. I welcome any recommendations you can provide ASAP. Thanks for your help here.
5 anos atrás
This remains unanswered -- our ability to style pages in nopCommerce shouldn't be hampered by the inability to configure tinyMCE. I will make a formal request for a fix for this in the admin.

[email protected] wrote:
Does anybody knows how to configure tinymce to allow style tag.
Actually when I start html with this :


<style type="text/css"> table, tr, td, p { color: #5C5B5B; font-family : 'Century Gothic',Arial,sans-serif; font-size: 14px} table { table-layout:fixed; } </style>
<table border="0" cellpadding="0" cellspacing="0" height="100%" style="background-color: #F4F4F4; width: 100%; height : 100%" width="100%">
  <tr>...


tinymce removes the style tag :(
I tried to add
valid_children: "+body[style]",
valid_elements: "*[*]"

in tinyMCE.init() but it does not work

Any idea?

ps : I already know it's not very nice to do this, but this trick is sometime necessary in emails templates ;)

FYI, I am running into the same challenge and have tried adding:

valid_children: "+body[style]",
valid_elements: "*[*]"


to no avail. We need to customize certain pages with different styling and so need a solution. I welcome any recommendations you can provide ASAP. Thanks for your help here.
5 anos atrás
It is possible to add TinyMCE initialization via settings in nopCommerce 4.00. Maybe is possible in other versions as well.

Insert the code below into the setting "adminareasettings.richeditoradditionalsettings".


settings.valid_children = "+body[style]";
5 anos atrás
You have to edit the RichEditor.cshtml with the following  settings

var defaultEditorSettings@(random) = {
            selector: "#@ViewData.TemplateInfo.GetFullHtmlFieldId(string.Empty)",
            fontsize_formats: "8pt 9pt 10pt 11pt 12pt 26pt 36pt",
            height: 200,
            width: '100%',
            apply_source_formatting: false,
            verify_html: false,

            autoresize_min_height: 200,
            autoresize_max_height: 200,


Add the above highlighted settings and you will be able to add any kind of tags
3 anos atrás
[email protected] wrote:
You have to edit the RichEditor.cshtml with the following  settings

var defaultEditorSettings@(random) = {
            selector: "#@ViewData.TemplateInfo.GetFullHtmlFieldId(string.Empty)",
            fontsize_formats: "8pt 9pt 10pt 11pt 12pt 26pt 36pt",
            height: 200,
            width: '100%',
            apply_source_formatting: false,
            verify_html: false,

            autoresize_min_height: 200,
            autoresize_max_height: 200,


Add the above highlighted settings and you will be able to add any kind of tags


Which versions is this supposed to work in?  I've had enough with having to fight with the editor to get my code to work, so I've decided to try and disable the auto correct of the HTML editor and implemented this code change, but it did not work.

We are running version 3.9.
3 anos atrás
ok.... after digging around on Google, I've come across some changes that I've implemented that seem to have helped.

Here are the lines I've added to the the richdeditor.cshtml file under the defaultEditorSettings variable definition -

Note that I'm going to be doing some additional research on these along with testing to see if they need to stay in place or if I can remove some of them -

trim_span_elements: false,
verify_html:false,
cleanup: false,
convert_urls: false,
apply_source_formatting: false,
cleanup_on_startup: false,
force_br_newlines : true,
force_p_newlines : false,
forced_root_block : '',
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.