Steffen
Well-known member
- Affected version
- 2.1.0
When you upload an image and insert it into your post then XenForo sets its
Example (filename "800px-Big_buck_bunny_poster_big.jpg" is replace by "195039"):
Unless I'm missing something, could you please use the filename as the value for the
alt
attribute (BB code as well as HTML) to the attachment_id
. The result is that all newly uploaded attachments have useless numeric alt attributes. This does not make any sense to me. It furthermore seems bad for SEO (in contrast to the attachment_id
, the filename usually contains at least some useful information). Am I missing something?Example (filename "800px-Big_buck_bunny_poster_big.jpg" is replace by "195039"):
Unless I'm missing something, could you please use the filename as the value for the
alt
attribute?
Diff:
--- a/js/xf/attachment_manager.js
+++ b/js/xf/attachment_manager.js
@@ -494,7 +494,7 @@
if (type == 'image')
{
- html = '<img src="{{img}}" data-attachment="full:{{id}}" alt="{{id}}" />';
+ html = '<img src="{{img}}" data-attachment="full:{{id}}" alt="{{img.alt}}" />';
}
else
{
@@ -511,7 +511,7 @@
}
bbCode = '[ATTACH]' + attachmentId + '[/ATTACH]';
- html = '<img src="{{img}}" data-attachment="thumb:{{id}}" alt="{{id}}" />';
+ html = '<img src="{{img}}" data-attachment="thumb:{{id}}" alt="{{img.alt}}" />';
}
html = Mustache.render(html, params);