Template:Attribute/doc: Difference between revisions
From Archaelund Wiki
(Created page with "== Description == This template searches for an attribute tag within a given string and outputs a description (either as text or image) if the tag is found (otherwise the outp...") |
No edit summary |
||
| Line 23: | Line 23: | ||
<tr><th>Format</th><th>Description</th><th>Example output</th></tr> | <tr><th>Format</th><th>Description</th><th>Example output</th></tr> | ||
<tr><td>Text</td><td>Outputs the text specified in parameter <Text>, followed by a semicolon.</td><td>{{Attribute|Text|Test|Tag=Test|Text=test attribute|Image=Experiment.png}}</td></tr> | <tr><td>Text</td><td>Outputs the text specified in parameter <Text>, followed by a semicolon.</td><td>{{Attribute|Text|Test|Tag=Test|Text=test attribute|Image=Experiment.png}}</td></tr> | ||
<tr><td>Image</td><td>Outputs the image specified in parameter <Image>, followed by a | <tr><td>Image</td><td>Outputs the image specified in parameter <Image>, followed by a semicolon. The text specified in parameter <Text> is shown as a tooltip.</td><td>{{Attribute|Image|Test|Tag=Test|Text=test attribute|Image=Experiment.png}}</td></tr> | ||
<tr><td>Tag</td><td>Outputs the tag specified in parameter <Tag>, followed by a semicolon.</td><td>{{Attribute|Tag|Test|Tag=Test|Text=test attribute|Image=Experiment.png}}</td></tr> | <tr><td>Tag</td><td>Outputs the tag specified in parameter <Tag>, followed by a semicolon.</td><td>{{Attribute|Tag|Test|Tag=Test|Text=test attribute|Image=Experiment.png}}</td></tr> | ||
</table> | </table> | ||
Note that the output is primarily intended for building attribute lists, which is why additional | Note that the output is primarily intended for building attribute lists, which is why an additional separator (semicolon) is appended. | ||
Latest revision as of 13:48, 15 March 2020
Description
This template searches for an attribute tag within a given string and outputs a description (either as text or image) if the tag is found (otherwise the output is empty). It is not meant to be directly called from within Wiki pages, but for generating customized attribute lists in other templates.
Usage
{{Attribute|<format>|<string>
|Tag =
|Text =
|Image =
}}
Parameters
| Name | Required | Description | Values |
|---|---|---|---|
| Tag | Yes | The name of the attribute tag to be searched for in <string>. | arbitrary text |
| Text | Yes | The text to be displayed if <Tag> is found in <string>. | arbitrary text |
| Image | No | The image to be displayed if <Tag> is found in <string>. | image name (including file extension) |
Format options
| Format | Description | Example output |
|---|---|---|
| Text | Outputs the text specified in parameter <Text>, followed by a semicolon. | test attribute; |
| Image | Outputs the image specified in parameter <Image>, followed by a semicolon. The text specified in parameter <Text> is shown as a tooltip. | |
| Tag | Outputs the tag specified in parameter <Tag>, followed by a semicolon. | Test; |
Note that the output is primarily intended for building attribute lists, which is why an additional separator (semicolon) is appended.