Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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.
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?
Sorry, I completely missed this response.
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.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted