[Solved] FileUpload add image alt
Noticed fileupload doesnt include alt text for image.
So With the code below: What do I need to add to include alt text for images ?
<?php
$Path = GetValue('Path', $Media);
$Img = '';
if ($CanDownload) {
$DownloadUrl = Url(MediaModel::Url($Media));
$Img = '<a class="lightbox1" title="User Image" href="'.$DownloadUrl.'">';
}
$ThumbnailUrl = MediaModel::ThumbnailUrl($Media);
$Img .= Img($ThumbnailUrl, array('class' => 'ImageThumbnail'));
if ($CanDownload)
$Img .= '';
echo $Img;
?>
I just want ONE size fits all alt , example: alt="User Image"
There was an error rendering this rich post.
Comments
Are you changing it in the php code or via jquery
so this doesn't work or have I misread what you want.
$Img = '<a class="lightbox1" title="User Image" alt="User Image" href="'.$DownloadUrl.'">';
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
In the php above preferably. I just need to add this exactly. alt="User Image" somewhere to the above code chunk.
Needs to defined in the array.
There was an error rendering this rich post.
try this, I haven't tested.
$Img .= Img($ThumbnailUrl, array('class' => 'ImageThumbnail','alt'=>'User Image'));
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Perfect thankyou
There was an error rendering this rich post.
Result: ( markup now validates )
There was an error rendering this rich post.
How do I accept your answer @Peregrine I dont see anywhere to click to accept ?
Or have the "powers that be" moved stuff around ?
There was an error rendering this rich post.
No, it depends on the category whether you see that 'accept' functionality. Don't know why.
I'll mark it as solved?
There was an error rendering this rich post.