PREVIEW ENVIRONMENT - This is not the production database. Changes will NOT be saved.

Template:ShowInstrument: Difference between revisions

From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
Jump to navigationJump to search
Shrink inline icon from 22px to 10px to avoid disrupting line flow (via update-page on MediaWiki MCP Server)
Use explicit width/height on inner icon span so calc(100% - 8px) resolves against 18px instead of the 9px outer container (via update-page on MediaWiki MCP Server)
 
(19 intermediate revisions by 3 users not shown)
Line 7: Line 7:
</pre>
</pre>


Outputs: a link to the musician's page, followed by a small instrument icon with tooltip (if they have a primary instrument set).
With instrument override:
<pre>
{{ShowInstrument|Jake Stargel|bass}}
</pre>


If the musician has no instrument set, it falls back to a plain link (same as the old {{Musician}} template).
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.


== 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:{{#show:{{{1}}}|?Primary instrument|link=none|headers=hide|default=}}|&nbsp;<span title="{{lc:{{#show:{{{1}}}|?Primary instrument|link=none|headers=hide}}}}">[[File:Instrument-icon-{{lc:{{#show:{{{1}}}|?Primary instrument|link=none|headers=hide}}}}.png|10px|{{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;{{#switch:{{lc:{{{2}}}}}|banjo|guitar|mandolin|ukulele=transform:rotate(-30deg);|}}"><span style="display:inline-block;width:20px;height:20px;">[[File:Instrument-icon-{{lc:{{{2}}}}}.png|x20px|{{lc:{{{2}}}}}|link=]]</span></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;position: relative;top: -4px;left: -2px;width: 9px;{{#switch:{{lc:{{#show:{{{1}}}|?Primary instrument|link=none|headers=hide}}}}|banjo|guitar|mandolin|ukulele=transform:rotate(-30deg);|}}"><span style="display:inline-block;width:18px;height:18px;">[[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></span>}}}}</includeonly>

Latest revision as of 17:44, 1 February 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.

See also