Difference between revisions of "Template:Q"
(Error message if invalid Page or Property is provided) |
|||
Line 1: | Line 1: | ||
− | <includeonly>{{# | + | <includeonly>{{#if:{{#vardefineecho:q|{{#show: {{{1}}} | ?{{{2}}} | link = none }} }}|{{{5|}}}{{#var:q}}{{{4|}}}|{{{3| <span style="color: red;">'''(Error: Page or property not found)'''</span> }}} }}</includeonly><noinclude>{{documentation}}</noinclude> |
Revision as of 12:39, 23 June 2022
Description
This template shows the specified property of a page. Can be used within tables or anywhere.
Syntax
{{Q|page|property|default text|suffix|prefix}}
Required parameters:
Page: The name of the page to be queried against.
Property: Show the value of this property.
Optional parameters:
Default text: Text to be displayed if the query has nothing to display. Typically this is N/A or a dash.
Suffix: Text to be displayed immediately after the query result.
Prefix: Text to be displayed immediately before the query result.
Samples
Typing:
{{Q|Gold|Beauty Offset}}
Gives: 20
Typing:
{{Q|Muffalo|Carrying Capacity|| kg|Muffalo carrying capacity: }}
Gives: Muffalo carrying capacity: 180 kg
Bulk examples
This is inline 20 this is inline
This item doesn't exist and is inline (Error: Page or property not found) this is inline
This is directly put next to-20, macaroni
Thinking up examples is making me hungry but this para doesn't exist,(Error: Page or property not found), oh well
Ooh defaults this time 20 yum yum
What no sandwich what about now Sandwich yum yum
All together now-Sandwichyum yum
The above documentation is transcluded from Template:Q/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |