Copied to clipboard

Flag this post as spam?

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


  • Jo Mixon 13 posts 83 karma points
    Jun 25, 2021 @ 19:06
    Jo Mixon
    0

    Image and Media Question 8.8 Alt Text

    Our partners are wanting to use the Alt Text on an Image when they enter a image via the Editor for compliance purposes but doesn't always want to have a caption. It appears that you can enter the Alt Text in the field but then it just transfers to the Caption field. Then, in the Media.cshtml Partial there is a check for the altText but it never finds it even though you enter it in. It's like the altText turns into the caption.

    Is there a way I can use the altText as it's defined? Or is there a way I can use the ID in the media.cshtml as I have access to that to pull the Alt Text from the original image? Media.cshmlt pulls in a dynamic model and my attempts at using Model.GetImageByID or whatever the function is called failed as well as the Library.Media(ID) or close function. Just naming these from memory to complete the thought for this thread.

    Appreciate any thoughts on the topic.

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Jul 02, 2021 @ 00:48
    Alex Skrypnyk
    0

    Hi Jo

    If you want to have full control over the generated code in your RTE, for example, maybe it makes sense to create a custom macro?

    How do you insert images in the content?

    Thanks, Alex

  • Jo Mixon 13 posts 83 karma points
    Jul 09, 2021 @ 13:28
    Jo Mixon
    0

    Hey Alex,

    Sorry, I completely missed this response. enter image description here

    enter image description here

    enter image description here

    enter image description here

    So, for me looking at all of this. It appears that something isn't correct with how the Alternate Text (optional) is supposed to work. When I type something into that Alternate Text field it takes that text and copies it under the image in the caption section and I have no idea if this is the way Umbraco wants to handle this? But, to me why have a check for AltText in the code and caption text if there will never be AltText?

    The work around for this in order to always provide some type of AltText as it's per the clients request is to check to see if there is a caption use the caption as the AltText, and if there is no caption use the fileName of the image. Not the best solution but it has seemed to be the only option.

Please Sign in or register to post replies

Write your reply to:

Draft