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
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|}}}|{{#if:{{{caption|}}}|alt={{{caption|}}}|}}}|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 <code>[[File:...|alt=...]]</code> markup directly; this template remains for manual use or body images.
 
Used by all Infobox templates in this wiki.


Parameters:
Parameters:
Line 9: Line 7:
* caption / 3 — fallback alt text when alt is empty
* 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>

Revision as of 02:57, 21 June 2026

Optional Template:Image alt helper. Infobox templates use inline ... markup directly; this template remains for manual use or body images.

Parameters:

  • file / 1 — image filename (without the File: prefix)
  • 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)