Im using EPiServer 7.1 btw.
I found the following code but where do I put it? Can I pass some options in a attribute on the property perhaps?
tinyMCE.init({ mode : "textareas", theme : "advanced", force_br_newlines : false, force_p_newlines : false, forced_root_block : '', });
Hi,
You can add init option by using this method http://krompaco.nu/2010/05/alter-default-initoptions-for-tinymce-in-episerver-6/.
Thanks! Will try that tomorrow. I've tried the following today, im just courious why this doesn't work?
I created a custom EditorDescriptor and decorated my property with it. Then in my EditorDescriptor I did the following:
public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes) { var model = (PropertyData) metadata.Model; var settings = (TinyMCESettings)(model).GetSetting(typeof(TinyMCESettings)); var options = new TinyMCEInitOptions(TinyMCEInitOptions.InitType.EditMode, settings, (IContent)null); options.Add("forced_root_block", string.Empty); metadata.EditorConfiguration["settings"] = options.InitOptions; base.ModifyMetadata(metadata, attributes); }
I can see all the options when debugging but I get a 500 error when loading this in Edit mode.
Can update tomorrow with a more detailed error.
Jonas, your solution worked, but now Im not getting any p tags wrapping my text(obviously).
Do you guys know any setting that just prevents wrapping a img element with a p tag?
I could use regex to remove it but that's really ugly...
hi
i used two solutions for this problem
1. went to the tinymce file and in the appdata ( in the zip ) added the force_br_newlines false also added alot of other issues and zipeed again and it worked
use the a dev toolbar to get the file location
this is the hammer approch
2. after i got helped from the support you need to create a plugin to tinymce and set the values
this is the default add the one you need, also you need to write the same as the example ('' and , ) if not all the cms ui stops working
[TinyMCEPluginNonVisualAttribute(
AlwaysEnabled = true,
PlugInName = "NonVisualPlugin",
DisplayName = "Custom editor init options",
Description = "Loads custom editor init options.",
EditorInitConfigurationOptions = @"{
paste_auto_cleanup_on_paste : true,
convert_urls: false,
valid_elements : ""a[href],strong/b,em/i,br,ul,ol,li,-h2,-h3,-h4,-h5,-h6,-p"",
theme_advanced_blockformats : ""h2,h3,h4,h5,h6,p"",
theme_advanced_resizing : false,
body_class : ""module-text""
}")]
public class NonVisualPlugin
{
}
You also need to create the a blank javascript file named editor_plugin.js at this location:
Util\Editor\tinymce\plugins\<your_plugin_name>\
Hey
How do I remove/prevent TinyMce to wrap my Imagevault tag in a p tag?
Now im getting the following html:
But I want this: