Copied to clipboard

Flag this post as spam?

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


  • Ed Parry 64 posts 252 karma points c-trib
    Jul 13, 2015 @ 14:46
    Ed Parry
    0

    Include image title in TinyMCE rich-text editor

    Hi,

    I'm trying to figure out how I can include the title attribute for an image selected by an editor within the TinyMCE rich-text editor? The alt text works as expected, but I would expect it to be possible to either set the title text separately, or use the alt text as a title as well?

  • Ed Parry 64 posts 252 karma points c-trib
    Jul 14, 2015 @ 10:22
    Ed Parry
    0

    Don't suppose any one has any tips for this one? I can't seem to find a way around it that isn't developing a macro to use rather than the media picker?

  • Al Nicholl 15 posts 97 karma points
    Nov 15, 2016 @ 20:32
    Al Nicholl
    0

    Hi Ed,

    Don't know if you still need help with this but here's how I solved it in v 7.5.4:

    Open up the file /Umbraco/Js/umbraco.services.js and change line 6711 from:

    var data = {
                   alt: img.altText || "",
                   src: (img.url) ? img.url : "nothing.jpg",
                   rel: img.id,
                   'data-id': img.id,
                   id: '__mcenew'
               };
    

    to:

    var data = {
                   alt: img.altText || "",
                   title: img.altText || "",
                   src: (img.url) ? img.url : "nothing.jpg",
                   rel: img.id,
                   'data-id': img.id,
                   id: '__mcenew'
               };
    

    then open your /Config/ClientDependancy.config file and increase the version attribute of the clientDependency node by 1 and save it.

    Now refresh your backend browser window, go to the page you want to add the image to and try again. This time you should see the title attribute added to the img tag.

    N.B. When you update Umbraco this fix will get overwritten so make a note somewhere when upgrading to add this back in until it or another fix gets implemented in the core.

    Hope this helps.

    Cheers,

    Al

  • Ed Parry 64 posts 252 karma points c-trib
    Dec 21, 2016 @ 10:15
    Ed Parry
    0

    Hi Al,

    Thanks for taking the time to respond! I never did get around to resolving this one, but it's still on my mind. This looks to do the job nicely!

    Ed

  • Al Nicholl 15 posts 97 karma points
    Dec 21, 2016 @ 10:22
    Al Nicholl
    0

    No problem, Ed.

    It's the best workaround I've found. Shame it's a bit of a hack though and will get overwritten on an upgrade if not remembered.

    Anyway, I hope this scratches your Umbraco itch. Merry Christmas!

    Al

Please Sign in or register to post replies

Write your reply to:

Draft