Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • trfletch 598 posts 604 karma points
    Jan 20, 2012 @ 13:20
    trfletch
    0

    Adding plugins to rich text editor (RTE) in custom section usercontrol

    Hi,

    I have an Umbraco 4.7.1.1 website and I have created a custom section with a usercontrol that uses the rich text editor, this all works fine but the problem I have is that I want to add some extra plugins to the RTE for example "legacyoutput".

    I am using the following code and when I debug the code in Visual Studio it shows that it has added "legacyoutput" to the end of the plugin's list (when I hover over "control" in the line "placeholder.Controls.Add(control)").

    The problem is when I view the source of the usercontrol in Umbraco then the "legacyoutput" plugin has not been added (it just shows a list of the standard plugins that umbraco uses) and it does not appear to be working. Does anyone know what could be causing this? Something seems to be removing the additional plugin from the list or overwriting the list after the code that I have added?

    private static void PutTinyMce(ref TinyMCE control, string controlId, PlaceHolder placeHolder, TabPage tab)  
    {    
         DataTypeDefinition d = DataTypeDefinition.GetDataTypeDefinition(-87); // TinyMCE DataType (could be your own datatype)    
    
         control = (umbraco.editorControls.tinyMCE3.TinyMCE)d.DataType.DataEditor;
         control.ID = controlId; 
         control.Plugins += ",legacyoutput";
         placeHolder.Controls.Add(control); 
         tab.Menu.NewElement("div", "umbTinymceMenu_" + control.ClientID, "tinymceMenuBar", 0); // Add TinyMCE controls to menu bar  
    }

    Hopefully something can help with this :-)

    Regards
    Tony

     

  • trfletch 598 posts 604 karma points
    Feb 27, 2012 @ 18:12
    trfletch
    0

    Is there no-one out there that can offer any insight into this?

    I really need to be able to add some plugins to my RTE in my custom section but I need to keep the standard umbraco one's that allow you to insert links and images.

Please Sign in or register to post replies

Write your reply to:

Draft