Copied to clipboard

Flag this post as spam?

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


  • Simon Dingley 1393 posts 3246 karma points c-trib
    Nov 29, 2013 @ 13:23
    Simon Dingley
    0

    TinyMce RTE Macro Property Type

    This is a v4.11.x site, I thought I should say that up front as v6.x/v7.x is likely very different in terms of implemenation of this sort of feature.

    At the request of a client I recently ported the SimpleEditor to a Macro Property type which was actually much easier than I expected. Now the requirements have changed and they need simplified version of the TinyMce RTE.

    I've successfully got this rendering in the UI and it is functional aside from a few quirks which actually relate to features I don't need at present so I can ignore them for now. The problem I have is that whilst the RTE renders and is functional the modal macro editor window cannot close due to a javascript error which is caused by the fact that tinyMCE.activeEditor is null in the plugins/tinymce3/insertMacro.aspx file.

    Ordinarily I would assume that the activeEditor would be the editor which spawned the macro property editor and is now confused by the fact that we have introduced a new instance into the mix. I want to try and complete this without hacking the core if I can.

    Here is my class for the property type:

    public class RichTextEditor : TinyMCEWebControl, IMacroGuiRendering
      {
        protected override void OnInit(EventArgs e)
        {
          base.OnInit(e);
          base.Width = 200;
          this.config.Add("skin", "umbraco");
          this.config.Add("theme_umbraco_buttons1", "code,removeformat,separator,undo,redo,separator,bold,italic,separator,bullist,numlist,separator,link,unlink,anchor,separator,charmap");
          this.config.Add("theme_umbraco_buttons2", string.Empty);
          this.config.Add("theme_umbraco_buttons3", string.Empty);
          this.config.Add("plugins", "spellchecker");
        }
        public string Value
        {
          get
          {
            return this.Text;
          }
          set
          {
            this.Text = value;
          }
        }
        public bool ShowCaption
        {
          get
          {
            return true;
          }
        }
      }

    Any ideas appreciated.

    Thanks, Simon

  • Bradley Kronson 58 posts 109 karma points
    Oct 20, 2014 @ 13:18
    Bradley Kronson
    0

    Hey Simon

    Did you ever manage to resolve this ? Any suggestions would be appreciated :)

  • Simon Dingley 1393 posts 3246 karma points c-trib
    Oct 20, 2014 @ 13:30
    Simon Dingley
    0

    Not using TinyMce unfortunately, it was taking more time than it was worth and would have ended up being a dirty hack so from memory the client agreed to change the scope of work. I think I did kind of get it working using an alternate third party RTE as it didn't have the interference of the existing Umbraco RTE configuration.

    Simon

  • Bradley Kronson 58 posts 109 karma points
    Oct 20, 2014 @ 13:57
    Bradley Kronson
    0

    Yup, thats what I ended up doing too...

Please Sign in or register to post replies

Write your reply to:

Draft