Can I get a WYSIWYG editor on the Long String property?

Vote:
 

Is it possible to get a WYSIWYG editor on the Long String property?

My users need WYSIWYG editing, but they also need to do some non-standard things to the HTML on occasion.  The XHTML string property keeps "cleaning" their HTML, and stripping their edits out.  I know that Long String won't do this, but I don't get a WYSIWYG editor when I use that.

#38215
Apr 03, 2010 0:58
Vote:
 

I think the easiest way to solve the problem it to create youre own custom long string property but inhereit from the xhtml and override the html cleaning functionality.

If you don't use it I highly recommend a tool called reflector. With it you can check out the episerver implementation.

Edit: Missed that the qustion was about cms 6.

Per

#38218
Edited, Apr 03, 2010 10:37
Vote:
 

If you are using the TinyMCE editor it as you say automatically clean your HTML, and removes any invalid code. Sometimes this is not what you want (one example is the Dynamic Content that comes with episerver that uses attributes with data (that never renders but needs to be there). There is a way to solve this but it requires a little knowledge about the editor and how to make plugins. 

 

Start by looking at this tech note: http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-6/EPiServer-CMS-6-RC1/Adding-a-TinyMCE-Plug-in/ take note to the EditorInitConfigurationOptions property on the plugin attribute. This property is used to edit the javascript settings of the editor. And then with this you can edit what elements/attributes tinyMCE cleans or keeps using the tinyMCE extended valid elements list see here: http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/extended_valid_elements. This should give you the possibility to add a plugin that makes the editor allow special html tag and attributes on the editors where you have your plugin enabled.

 

Hope that gives you some pointers. Please tell if you have any problems.

#38239
Apr 06, 2010 8:31
Vote:
 

Johan, you were right.  It wasn't the XHTML property that was cleaning this content up, it was TinyMCE.  Thanks for the heads-up.

#38663
Edited, Apr 16, 2010 17:12
Vote:
 

Great that you found the problem. Its not easy separating what TinyMCE do and what EPiServer do. I think there might also be some additional cleaning possibility deeped down in EPi. But most should be solvable with TinyMCE and pligins for it.

Feel free to mark the thread as answered so other people easily can find the answer.

#38664
Apr 16, 2010 17:20
Vote:
 

Here is an example made from the info on Johan's links:

using EPiServer.Editor.TinyMCE;
namespace TinyMCEValidElements.Example
{
    [TinyMCEPluginNonVisual(AlwaysEnabled = true,
        PlugInName = "CustomEditorSettings",
        DisplayName = "Init options",
        Description = "Custom editor init options.",
        EditorInitConfigurationOptions = @"{
            extended_valid_elements: ""ol[id|class|style|start|type]"" }")]
    public class CustomizedEditor { }
}

#42851
Sep 03, 2010 0:16
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.