Template:MiniMoveCard: Difference between revisions

Template page
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{#vardefine:gameTable|{{#if:{{{game|}}}|{{{game|}}}|{{BASEPAGENAME}}}}}} <!-- If a game is not provided, fall back to the base page name --><includeonly>{{Tt|{{{label|{{{input}}}}}}|{{#cargo_query:tables=MoveData_{{#var:gameTable}},MoveData_{{#var:gameTable}}__images|join on=MoveData_{{#var:gameTable}}._ID=MoveData_{{#var:gameTable}}__images._rowID|fields=images=image,name,guard,startup,recovery,onBlock|where=chara="{{{chara}}}" and input="{{{input}}}"|format=template|template=TooltipMovePreview|named args=yes|limit=1|more results text=}}}}</includeonly><noinclude>A template for shorthand writing cargo queries for displaying a mini move card.
{{#vardefine:gameTable|{{#if:{{{game|}}}|{{{game|}}}|{{BASEPAGENAME}}}}}} <!-- If a game is not provided, fall back to the base page name -->
{{#vardefine:targetChara|{{#if:{{{chara|}}}|{{{chara|}}}|{{#titleparts:{{PAGENAME}}|1|2}}}}}} <!-- If a game is not provided, fall back to the base page name --><includeonly>{{Tt|{{{label|{{{input}}}}}}|{{#cargo_query:tables=MoveData_{{#var:gameTable}},MoveData_{{#var:gameTable}}__images|join on=MoveData_{{#var:gameTable}}._ID=MoveData_{{#var:gameTable}}__images._rowID|fields=images=image,name,guard,startup,recovery,onBlock|where=chara="{{#var:targetChara}}" and input="{{{input}}}"|format=template|template=TooltipMovePreview|named args=yes|limit=1|more results text=}}}}</includeonly><noinclude>A template for shorthand writing cargo queries for displaying a mini move card.


==Usage==
==Usage==

Revision as of 00:20, 1 March 2022

A template for shorthand writing cargo queries for displaying a mini move card.

Usage

Due to weirdness with mediawiki, you must use the MiniMoveCard inside of a container, such as a div. This will be automatically done for you if it's in a move card on the overview, but for other pages you will need to add the div yourself.

 Expects 2 arguments:
 chara = name of the character for the cargo query
 input = input for the move for the cargo query
 optional arguments:
 game  = name of the game as it appears in the cargo table. If this is not provided, it will assume the game from the BasePageName of the current page.
 label = whatever text you want the tooltip to appear over. If not provided, uses the move input instead

Examples

Default Behavior

<div>Lorem ipsum dolor sit amet, {{MiniMoveCard|chara=Testament|input=236P|game=GGML}}, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
Lorem ipsum dolor sit amet, 236PGGML Testament 236P.pngGuardAllStartup18RecoveryAdvantage+3, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

With label

<div>Lorem ipsum dolor sit amet, {{MiniMoveCard|chara=Sol Badguy|input=214S|game=GGST|label=Grand Viper}, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
Lorem ipsum dolor sit amet, Grand ViperGGST Sol Badguy 214S 1.pngGuardAllStartup15~31 [32]Recovery32 [26]Advantage-17, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.