Copied to clipboard

Flag this post as spam?

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


  • Fernando Camillo 41 posts 82 karma points
    Dec 07, 2010 @ 13:41
    Fernando Camillo
    0

    Custom upload control: problem with TinyMCE v3

    Hi.

    I developed a custom upload control (umbraco usercontrol wrapper .ascx) for use in the Media section. The control works fine, saves the image, it's thumbnail, update properties, etc. But in the TinyMCE editor, in the "Insert Link" window, the media I've uploaded points to a null page: /umbraco/plugins/tinymce3/null.

    If I change the datatype back to umbraco's default upload control, it works as expected. Obs: In the TinyMCE "Insert Image" window this problem doesn't occur.

    So, I developed a second custom upload control, copying from the umbraco source code (http://umbraco.codeplex.com/SourceControl/changeset/view/45714#450950). I give it a unique GUID, etc. Its working, but the same problem occurs.

    Is this a bug? The TinyMCE "Insert Link" window accepts only media uploaded with umbraco default upload control?

    Thanks!

    Fernando

  • Fernando Camillo 41 posts 82 karma points
    Dec 09, 2010 @ 18:33
    Fernando Camillo
    0

    Hi.

    I found the solution by myself while searching the source code. Here it goes...

    We must add the Guid of the custom control in the static list "LinkableMediaDataTypes" at "umbraco.loadMedia" class. This tells the WYSIWYG editor that it's media type is "linkable".

    Well... I don't know if what I did is correct or elegant, but I put this line in the "insertLink.aspx" file:

    <% umbraco.loadMedia.LinkableMediaDataTypes.Add(new Guid("myControlGuid!")); %>

    If anyone knows a better way, I would appreciate.

    Fernando

    Umbraco 4.5.2

Please Sign in or register to post replies

Write your reply to:

Draft