Image elements do not have explicit width and height

Started by spiros, April 17, 2021, 01:27:00 PM

Previous topic - Next topic

spiros

When testing a page with Chrome Lighthouse I get: Image elements do not have explicit width and height for the admin etc icons that are set via EDIT MEMBERGROUP:

Star image filename:
you can use $language for the language of the user{theme URL}/images/


How can this be fixed? I.e. give values to those images.

I can see in ManageMembergroups.template.php
<label for="star_image_input"><strong>', $txt['membergroups_star_image'], ':</strong></label><br />
<span class="smalltext">', $txt['membergroups_star_image_note'], '</span>
</dt>
<dd>
', $txt['membergroups_images_url'], '
<input type="text" name="star_image" id="star_image_input" value="', $context['group']['star_image'], '" onchange="if (this.value &amp;&amp; this.form.star_count.value == 0) this.form.star_count.value = 1; else if (!this.value) this.form.star_count.value = 0; document.getElementById(\'star_preview\').src = smf_images_url + \'/\' + (this.value &amp;&amp; this.form.star_count.value > 0 ? this.value.replace(/\$language/g, \'', $context['user']['language'], '\') : \'blank.gif\');" size="20" class="input_text" />
<img id="star_preview" src="', $settings['images_url'], '/', $context['group']['star_image'] == '' ? 'blank.gif' : $context['group']['star_image'], '" alt="*" />
</dd>

Aleksi "Lex" Kilpinen

Since you can use pretty much any image as the "star" image, it's not really as simple as adding something to the template code showing the image.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

spiros

Well, I have a fixed size 16x16 for these images. I tried
'blank.gif' : $context['group']['star_image'], '"width="16" height="16" alt="*" />

But this change was not reflected on the site when viewing source.

Advertisement: