Jump to content

Template:Image alt: Difference between revisions

From The Aetherium Expanse Wiki
Automated sync from wiki-stories repository
 
Automated sync from wiki-stories repository
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly>[[File:{{{file|{{{1}}}}}|frameless|alt={{{alt|{{{caption|}}}}}}|class={{{class|infobox-image}}}]]</includeonly><noinclude>
<includeonly>[[File:{{{file|{{{1}}}}}|frameless|{{#if:{{{alt|}}}|alt={{{alt|}}}|}}|class={{{class|infobox-image}}}]]</includeonly><noinclude>
Install as '''Template:Image alt'''. Renders an infobox image with accessible alt text.
Optional '''Template:Image alt''' helper. Infobox templates use inline File markup with a separate {{#if}} alt block; do not nest <code>alt={{{a|{{{b|}}}}}}</code> before <code>|class=</code> or MediaWiki misparses the pipe.
 
Used by all Infobox templates in this wiki.


Parameters:
Parameters:
* file / 1 — image filename (without the File: prefix)
* file / 1 — image filename (without the File: prefix)
* alt / 2 — alt text for screen readers
* alt / 2 — alt text for screen readers
* caption / 3 — fallback alt text when alt is empty
* class — CSS class on the img element (default: infobox-image)
* class — CSS class on the img element (default: infobox-image)
Example:
{{Image alt
|file = example_infobox.png
|alt = Orbital view of a station above a gas giant
|class = infobox-image
}}
</noinclude>
</noinclude>

Latest revision as of 03:01, 21 June 2026

Optional Template:Image alt helper. Infobox templates use inline File markup with a separate {{#if}} alt block; do not nest alt= before |class= or MediaWiki misparses the pipe.

Parameters:

  • file / 1 — image filename (without the File: prefix)
  • alt / 2 — alt text for screen readers
  • class — CSS class on the img element (default: infobox-image)