Template:ConcatImage/doc: Difference between revisions

Template page
No edit summary
Line 16: Line 16:
Would produce:
Would produce:
{{#cargo_query:
{{#cargo_query:
tables=item
tables=technology
|fields={{ConcatImage|name}},name=
|fields={{ConcatImage|name|256x256px}},name=
|format=list
|format=list
}}
}}

Revision as of 23:30, 10 July 2025

Usage

{{ConcatImage|file name|size}}

Takes a file name and produces a CONCAT statement which selects the field in a cargo query but produces an image of size. Size defaults to 64x64px

This is useful in selecting images directly based on column values:

{{#cargo_query:
tables=item
|fields={{ConcatImage|name}},name=
|format=list
}}

Would produce:

Error: Table technology not found.

Underling code:

CONCAT( '[[File:', {{{1}}}, '.png|{{{2|64x64px}}}|link=', {{{1}}}, ']]')</includeonly>