Copied to clipboard

Flag this post as spam?

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


  • Rune Antonsen 29 posts 145 karma points
    Mar 31, 2016 @ 13:23
    Rune Antonsen
    1

    RTE, Image, Grid

    I can't wrap my head around how to get this to work.

    What do I need to change to get slimmage to work on all images added either through Images in the RTE in a Grid, or through the Image selector in the Grid?

    I've tried changing settings in the tinymce umbracoimg image.js, to include class="slimmage" but that didn't work, didn't even add the test <p></p> tag I added. So not sure what's going on there, maybe I'm editing the wrong file.

    Any pointers would be highly appreciated.

  • Rune Antonsen 29 posts 145 karma points
    Apr 01, 2016 @ 07:28
    Rune Antonsen
    0

    So I found the grid image part. That was located in Views/Partials/Grid/Editors/Media.cshtml

    Now it's only the RTE image stuff left. More hacking!

  • Dennis Adolfi 1082 posts 6446 karma points MVP 5x c-trib
    Apr 01, 2016 @ 07:56
    Dennis Adolfi
    101

    Hi Rune!

    Try this:

    File: /Umbraco/Js/umbraco.services.js

    Code Line: 6306 Note: This is Umbraco 7.4.1 so the line might be different, but just search for the funtion in that js file.

    Function: insertMediaInEditor

                   var data = {
                       alt: img.altText || "",
                       src: (img.url) ? img.url : "nothing.jpg",
                       rel: img.id,
                       'data-id': img.id,
                       id: '__mcenew',
                       class: 'slimmage'
                   };
    
  • Rune Antonsen 29 posts 145 karma points
    Apr 01, 2016 @ 10:40
    Rune Antonsen
    1

    YES! Thanks a lot Dennis!

    Been spending hours trying to figure out this!

    Again, THANK YOU! :D

  • Dennis Adolfi 1082 posts 6446 karma points MVP 5x c-trib
    Apr 01, 2016 @ 10:57
    Dennis Adolfi
    2

    Hi Rune! Awsome that it worked for you!! Always happy to help!

    Good luck with the rest of yout Umbraco site and have a great day. :)

Please Sign in or register to post replies

Write your reply to:

Draft