Hi,
I finally contacted Kentico support who helped with a source code customisation valid for this scenario.
In the CMSApp solution I've had to edit the file \CMSModules\Content\Controls\Dialogs\Properties\HTMLMediaProperties.ascx.cs
There is the Validate() method where you can add the below within the MediaTypeEnum.Image case:
if (string.IsNullOrEmpty(txtAlt.Text))
{
txtAlt.Text = GetAltText(OriginalUrl);
}
You can add the following code e.g. on the line 1272, right before
errorMessage = errorMessage.Trim();
Please note that you would need to implement that GetAltText()
method that retrieves the MediaFileInfo
object by using MediaFileInfoProvider.GetMediaFileInfo()
Regards,
Gustavo