Template:ItemCard: Difference between revisions

From Blue Archive Wiki
Jump to navigation Jump to search
Content added Content deleted
(documented)
(css styling)
Line 1: Line 1:
<includeonly>{{#ifeq: {{{2|}}} | block | {{#vardefine:block_output | true }} }}{{#ifeq: {{{3|}}} | block | {{#vardefine:block_output | true }} }}{{#ifeq: {{{4|}}} | block | {{#vardefine:block_output | true }} }}{{#ifeq: {{{5|}}} | block | {{#vardefine:block_output | true }} }}{{#vardefine:dpldata | {{#dpl:| category=Items | titlematch=%/{{{1|}}} | format = ,,{{!}}%PAGE%, | include = {Item}:Icon:NameEN }} }}{{#vardefine:Icon | {{#explode:{{#var:dpldata}}|{{!}}|0}} }}{{#vardefine:Page | {{#explode:{{#var:dpldata}}|{{!}}|2}} }}{{#ifeq:{{{text|+}}}|{{{text|-}}} | {{#vardefine:Name | {{{text|}}} }} | {{#vardefine:Name | {{#explode:{{#var:dpldata}}|{{!}}|1}} }} }}{{#if: {{#var:block_output}} | <span style="display:inline-block;text-align:center;width:{{{2|32px}}}"> }}[[File:{{#var:Icon}}|{{{2|32px}}}|{{#var:Name}}|link={{#var:Page}}]]{{#if: {{#var:Name}} | [[{{#var:Page}}|{{#var:Name}}]] }}{{#if: {{#var:block_output}} | </span> }}{{#vardefine:block_output | }}{{#vardefine:Name | }}{{#vardefine:Icon | }}{{#vardefine:Page | }}</includeonly>
<includeonly>{{#ifeq: {{{2|}}} | block | {{#vardefine:block_output | true }} }}{{#ifeq: {{{3|}}} | block | {{#vardefine:block_output | true }} }}{{#ifeq: {{{4|}}} | block | {{#vardefine:block_output | true }} }}{{#ifeq: {{{5|}}} | block | {{#vardefine:block_output | true }} }}{{#vardefine:dpldata | {{#dpl:| category=Items | titlematch=%/{{{1|}}} | format = ,,{{!}}%PAGE%, | include = {Item}:Icon:NameEN }} }}{{#vardefine:Icon | {{#explode:{{#var:dpldata}}|{{!}}|0}} }}{{#vardefine:Page | {{#explode:{{#var:dpldata}}|{{!}}|2}} }}{{#ifeq:{{{text|+}}}|{{{text|-}}} | {{#vardefine:Name | {{{text|}}} }} | {{#vardefine:Name | {{#explode:{{#var:dpldata}}|{{!}}|1}} }} }}{{#if: {{#var:block_output}} | <span style="display:inline-block;text-align:center;width:{{{2|32px}}}"> }}[[File:{{#var:Icon}}|{{{2|32px}}}|{{#var:Name}}|link={{#var:Page}}|class=itemcard]]{{#if: {{#var:Name}} | [[{{#var:Page}}|{{#var:Name}}]] }}{{#if: {{#var:block_output}} | </span> }}{{#vardefine:block_output | }}{{#vardefine:Name | }}{{#vardefine:Icon | }}{{#vardefine:Page | }}</includeonly>
<noinclude>
<noinclude>
Outputs an image of the item that links back to its page.
Outputs an image of the item that links back to its page.

Revision as of 17:46, 22 February 2022


Outputs an image of the item that links back to its page.

Usage

{{ItemCard|Name[|32px[|text=AltName][|block]]}}

Options

  • 32px: image size with statement format corresponding to MediaWiki File size style (32px for set width, x32px for set height, 32x32px for arbitrary scaling); should be a width only value if using block output
  • text: alternative item name to display. Use text= to disable text output entirely
  • block: display card as a block element the width of the icon, with item name underneath

Examples

Teddy Bear with BowTeddy Bear with Bow


Wavecat PillowWavecat Pillow AltNameAltName Wavecat PillowWavecat Pillow