Copied to clipboard

Flag this post as spam?

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


  • Mike Chambers 636 posts 1253 karma points c-trib
    Feb 07, 2014 @ 15:45
    Mike Chambers
    0

    img src attribute in tinymce manipulation...

    so I have set up a custom image insert that inserts images generated from the cropper rather than just the uploaded media image.

    this all works fine...

    I end up with a img tag something like

    {img src="/media/1621/delete1_Square Crop.jpg" alt="Holding Image 1" title="Holding Image 1" width="370" height="370" rel="1250,855" data-crop="Square Crop" /}

    However, as soon as I save I think Umbraco is doing something intelligent and deciding that the image for /media/1621 should have the filename "delete1.jpg" :-(

    so after save my img tag becomes

    {img src="/media/1621/delete1.jpg" alt="Holding Image 1" title="Holding Image 1" width="370" height="370" rel="1250,855" data-crop="Square Crop" /}

    Anyone have any ideas how I can resolve this??

    I've looked around in the source for where this replacement might be being done.. perhaps   Umbraco-CMS / src / umbraco.editorControls / tinymce / tinyMCEImageHelper.cs but I can't see where I could alter to say ignore if my data-crop attribute existed?

    Reading around I tried removing the addition of the rel="origH, orgW" from image.js which works on the insertImage dialogue.. but on save rel="" reappears... plus I guess this is imbuilt required for showing resized images in the tinymce.

    I guess one way might be to have my crops generate outside of the /media/ folder if indeed the requirement for this conv is a regexp match on the path "/media/[\d]*/ " ????? but not looked at the feasibility of that yet.

    I'm grateful for any suggestions. Ta

Please Sign in or register to post replies

Write your reply to:

Draft