Skip to content

Commit

Permalink
Only set the alt variable if the media is an image file.
Browse files Browse the repository at this point in the history
  • Loading branch information
DrewBrasher committed Oct 10, 2024
1 parent 18a7f7a commit 63928d7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
var path = paths[i];
var url = Orchard.AssetUrl(path);
var text = !string.IsNullOrEmpty(mediaTexts.ElementAtOrDefault(i)) ? mediaTexts[i] : path;
var alt = !string.IsNullOrEmpty(mediaTexts.ElementAtOrDefault(i)) ? mediaTexts[i] : string.Empty;

if (Orchard.IsImageFile(path))
{
var alt = !string.IsNullOrEmpty(mediaTexts.ElementAtOrDefault(i)) ? mediaTexts[i] : string.Empty;
<img src="@url" alt="@alt">
}
else
Expand Down

0 comments on commit 63928d7

Please sign in to comment.