Copied to clipboard

Flag this post as spam?

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


  • Shada 55 posts 137 karma points
    Aug 03, 2015 @ 08:12
    Shada
    0

    media picker alt text - richtexteditor

    Hello! I created a property for the images (in Media Types section) called "AltText". Then I added the extension method GetAltText:

     public static string GetAltText(this IMedia media)
            {
                if (media.HasProperty("altText"))
                {
                    object altText = media.GetValue("altText");
                    if (altText != null)
                        return altText.ToString();
                }
                return "";
            }
    

    I want my property used when user insert a picture with the richtexteditor. Any ideas?

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Aug 03, 2015 @ 11:00
    Alex Skrypnyk
    0

    Hi Shada,

    So what the problem ? Do you want to past alt text in the richTexct editor ?

  • Shada 55 posts 137 karma points
    Aug 03, 2015 @ 11:38
    Shada
    0

    Now I can add alternitivny text in the image properties (AltText). In templates I just use my function GetAltText. But if the user is working with richtexteditor and adds image through media picker there is a default property "Alternative text (optional)". I need to add at the pictures in richtexteditor when unfilled property "Alternative text (optional)" use my property AltText

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Aug 03, 2015 @ 11:43
    Alex Skrypnyk
    0

    Shada, yes it's only way.

  • Mike Chambers 636 posts 1253 karma points c-trib
    Aug 24, 2015 @ 20:55
    Mike Chambers
    0

    I have a feeling you can manipulate the core js files (so no need to delve into aspnet and building the source) to some extent to get what you are after..

    \Umbraco_Client\Tinymce3\Plugins\Umbracoimg\Js\image.js
    

    is I think the javascript that you are going to have to manipulate.

    (just be careful of cacheing... changing the clientdependancy version no in \Config\ClientDependency.config should sort that)

Please Sign in or register to post replies

Write your reply to:

Draft