Template:IconLink: Difference between revisions
No edit summary |
No edit summary |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
| {{{3|{{{2}}}}}} | | {{{3|{{{2}}}}}} | ||
| link = {{{2}}} | | link = {{{2}}} | ||
| size = {{{size|}}} | |||
| w = {{{w|}}} | | w = {{{w|}}} | ||
| h = {{{h| | | h = {{{h|}}} | ||
| block = {{{block|}}} | | block = {{{block|}}} | ||
| gap = {{{gap|}}} | | gap = {{{gap|}}} | ||
| nowrap = {{{nowrap|}}} | |||
| class = {{{class|}}} | |||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
Usage: {{code|<nowiki>{{IconLink | Flourish Icon.png | Flourish }}</nowiki>}} | Usage: {{code|<nowiki>{{IconLink | Flourish Icon.png | Flourish }}</nowiki>}} | ||
Line 63: | Line 66: | ||
|} | |} | ||
[[Category:Icon | [[Category:Icon templates]] | ||
</noinclude> | |||
== Template parameters == | |||
<templatedata> | |||
{ | |||
"params": { | |||
"1": { | |||
"description": "The file to display as an icon, without the File: prefix.", | |||
"type": "string", | |||
"required": true | |||
}, | |||
"2": { | |||
"description": "Where to link to.", | |||
"type": "wiki-page-name", | |||
"required": true | |||
}, | |||
"3": { | |||
"description": "(optional) Replaces the link text with this if specified.", | |||
"type": "string" | |||
}, | |||
"w": { | |||
"description": "(optional) Override the width of the image.", | |||
"type": "number" | |||
}, | |||
"h": { | |||
"description": "(optional) Override the height of the image.", | |||
"type": "number" | |||
}, | |||
"size": { | |||
"description": "(optional) Set the size of the image to this by this.", | |||
"type": "number" | |||
}, | |||
"block": {}, | |||
"gap": {}, | |||
"nowrap": { | |||
"description": "If specified, will add the nowrap css style to the span.", | |||
"type": "boolean" | |||
}, | |||
"class": { | |||
"description": "Any classes to add to the img" | |||
} | |||
}, | |||
"paramOrder": [ | |||
"1", | |||
"2", | |||
"3", | |||
"w", | |||
"h", | |||
"size", | |||
"block", | |||
"gap", | |||
"nowrap", | |||
"class" | |||
], | |||
"description": "Insert a linked icon." | |||
} | |||
</templatedata></noinclude> |
Latest revision as of 15:27, 23 June 2024
Usage: {{IconLink | Flourish Icon.png | Flourish }}
Result:
The link text can be changed with a third parameter:
Usage: {{IconLink | Flourish Icon.png | Flourish | Custom Text }}
Result:
The default size is x40px
meaning the icon is scaled until the height is 40 px. It's usually important to limit the height since the icons are used inline, and a very high inline image makes for an unpleasant text layout.
An alternative value for the height can be provided via the size
or h
parameters, which are synonyms:
Usage: {{IconLink | size = 25 | Flourish Icon.png | Flourish }}
Result:
Usage: {{IconLink | size = 25 | Flourish Icon.png | Flourish | Custom Text }}
Result:
Behavior on missing icon:
The width can be set via the w
parameter. This could be useful if several elements are supposed to align vertically for design purposes, such as in the following table shown on our main page as of the writing of this documentation. This also uses the block
and gap
parameters. View the source of this page for usage.
Rolls | |
---|---|
The roll you make to determine whether an attack hits an enemy at all. | |
The roll you make to determine the amount of damage done by a successful attack. | |
The roll you make to attempt avoiding various threats other than direct attacks. | |
The roll you make when attempting anything else that requires a roll to succeed. | |
Modifiers | |
Roll the die twice, and use the higher result. Disadvantage is the exact opposite. | |
The number you add to your rolls based on your Ability Scores. | |
The number you add to your rolls based on whether you have Proficiency. |
Template parameters
Insert a linked icon.
Parameter | Description | Type | Status | |
---|---|---|---|---|
1 | 1 | The file to display as an icon, without the File: prefix. | String | required |
2 | 2 | Where to link to. | Page name | required |
3 | 3 | (optional) Replaces the link text with this if specified. | String | optional |
w | w | (optional) Override the width of the image. | Number | optional |
h | h | (optional) Override the height of the image. | Number | optional |
size | size | (optional) Set the size of the image to this by this. | Number | optional |
block | block | no description | Unknown | optional |
gap | gap | no description | Unknown | optional |
nowrap | nowrap | If specified, will add the nowrap css style to the span. | Boolean | optional |
class | class | Any classes to add to the img | Unknown | optional |