Copied to clipboard

Flag this post as spam?

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


  • AJS 31 posts 212 karma points
    Sep 23, 2015 @ 18:21
    AJS
    0

    Adding alt to images in media picker, multiple media picker and rich text editor

    Hi,

    I was hoping to add alt text to all of my images on my site since the site has to be 508 compliant.

    Is there a way to edit the media picker, multiple media picker and rich text editor to default to having an alt text field and/or title field?

    Thanks for any help in advance,

    Amanda

  • James Jackson-South 489 posts 1747 karma points c-trib
    Sep 23, 2015 @ 23:40
    James Jackson-South
    1

    Hi Amanda,

    For alt text on media items using the media and multimedia picker I generally use the name property for the media items.

    If you wanted to use a different property to allow it to be more descriptive you could build a media type that inherits from Image and add an AltText property. (You could probably even just add the property to Image.)

    That way you could keep the alt text consistent no matter where the image is used by a picker and retrieve it like any other property in your controllers/views.

    With the rich text editor in v7 the media picker offers an alt text field when picking an item. Keeping this in sync with the field that you added to Image would be tricky though. You'd probably have to dig around and create your own tinymce button.

    Hope that helps a little.

  • AJS 31 posts 212 karma points
    Sep 25, 2015 @ 20:59
    AJS
    0

    Hi James,

    Thanks so much for your reply. I guess I'm too much of a newbie to even know where to begin with this...

    For my site logo, I currently have :

    <img src="@Umbraco.Media(Model.Content.GetPropertyValue("siteLogo").ToString()).Url" alt="" width="200px" class="img-responsive" />
    

    (which I got from another thread)

    and I can technically use a property that I created called "siteTitle" for the alt tag, but I am wondering if there's any other way since I will have multiple images on a page that won't be able to use that property. You had mentioned the .Name property? How would I formulate that to correspond to a specific image? Would I use CurrentPage?

    My apologies for being such a newbie, and thanks in advance for your help.

    Best,

    Amanda

  • Pedro Adão 43 posts 80 karma points
    Oct 26, 2016 @ 17:42
    Pedro Adão
    0

    Hi,

    I have the same problem. I cannot use the media/imagem .Name because the website is a multilanguage website.

    Whats the best practice?

    Thanks, Pedro

Please Sign in or register to post replies

Write your reply to:

Draft