Template:ShowInstrument: Difference between revisions
From PickiPedia: A knowledge base of bluegrass, old time, and other traditional and public domain music
Jump to navigationJump to search
Remove vertical-align:middle per feedback (via update-page on MediaWiki MCP Server) |
Add vertical-align:baseline to override MW default vertical-align:middle on images (via update-page on MediaWiki MCP Server) |
||
| Line 18: | Line 18: | ||
== Styling == | == Styling == | ||
Icons use <code>line-height:0</code> so they don't affect text flow. They may slightly overlap adjacent text, which is intentional. | Icons use <code>line-height:0; vertical-align:baseline</code> so they don't affect text flow. They may slightly overlap adjacent text, which is intentional. The <code>vertical-align:baseline</code> overrides MediaWiki's default <code>vertical-align:middle</code> on images. | ||
== See also == | == See also == | ||
* [[Template:MusicianInfo]] - Sets the '''Primary instrument''' property | * [[Template:MusicianInfo]] - Sets the '''Primary instrument''' property | ||
* [[Template:ThinkingEntityInfo]] - Shows instrument icon in infobox | * [[Template:ThinkingEntityInfo]] - Shows instrument icon in infobox | ||
</noinclude><includeonly>[[{{{1}}}|{{#rambutanplain:{{{1}}}}}]]{{#if:{{{2|}}}|<span title="{{lc:{{{2}}}}}" style="display:inline-block;line-height:0;{{#switch:{{lc:{{{2}}}}}|banjo|guitar|mandolin|ukulele=transform:rotate(-30deg);|}}">[[File:Instrument-icon-{{lc:{{{2}}}}}.png|x18px|{{lc:{{{2}}}}}|link=]]</span>|{{#if:{{#show:{{{1}}}|?Primary instrument|link=none|headers=hide|default=}}|<span title="{{lc:{{#show:{{{1}}}|?Primary instrument|link=none|headers=hide}}}}" style="display:inline-block;line-height:0;{{#switch:{{lc:{{#show:{{{1}}}|?Primary instrument|link=none|headers=hide}}}}|banjo|guitar|mandolin|ukulele=transform:rotate(-30deg);|}}">[[File:Instrument-icon-{{lc:{{#show:{{{1}}}|?Primary instrument|link=none|headers=hide}}}}.png|x18px|{{lc:{{#show:{{{1}}}|?Primary instrument|link=none|headers=hide}}}}|link=]]</span>}}}}</includeonly> | </noinclude><includeonly>[[{{{1}}}|{{#rambutanplain:{{{1}}}}}]]{{#if:{{{2|}}}|<span title="{{lc:{{{2}}}}}" style="display:inline-block;line-height:0;vertical-align:baseline;{{#switch:{{lc:{{{2}}}}}|banjo|guitar|mandolin|ukulele=transform:rotate(-30deg);|}}">[[File:Instrument-icon-{{lc:{{{2}}}}}.png|x18px|{{lc:{{{2}}}}}|link=]]</span>|{{#if:{{#show:{{{1}}}|?Primary instrument|link=none|headers=hide|default=}}|<span title="{{lc:{{#show:{{{1}}}|?Primary instrument|link=none|headers=hide}}}}" style="display:inline-block;line-height:0;vertical-align:baseline;{{#switch:{{lc:{{#show:{{{1}}}|?Primary instrument|link=none|headers=hide}}}}|banjo|guitar|mandolin|ukulele=transform:rotate(-30deg);|}}">[[File:Instrument-icon-{{lc:{{#show:{{{1}}}|?Primary instrument|link=none|headers=hide}}}}.png|x18px|{{lc:{{#show:{{{1}}}|?Primary instrument|link=none|headers=hide}}}}|link=]]</span>}}}}</includeonly> | ||
Revision as of 19:50, 30 January 2026
Inline template for linking to a musician with their instrument icon. Queries the musician's Primary instrument semantic property and displays a small icon with a tooltip.
Usage
{{ShowInstrument|Cory Walker}}
With instrument override:
{{ShowInstrument|Jake Stargel|bass}}
The first form queries the musician's Primary instrument property. The second form overrides it with the specified instrument.
Rotation
Banjo, guitar, mandolin, and ukulele icons are rotated -30° to look natural at a playing angle. Fiddle, bass, dobro, tin whistle, autoharp, and vocals are displayed upright.
Styling
Icons use line-height:0; vertical-align:baseline so they don't affect text flow. They may slightly overlap adjacent text, which is intentional. The vertical-align:baseline overrides MediaWiki's default vertical-align:middle on images.
See also
- Template:MusicianInfo - Sets the Primary instrument property
- Template:ThinkingEntityInfo - Shows instrument icon in infobox