Template:IconLink: Difference between revisions
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
{{#vardefine: icon | {{{1}}} }} | {{#vardefine: icon | {{{1}}} }} | ||
{{#vardefine: link | {{{2}}} }} | {{#vardefine: link | {{{2}}} }} | ||
{{#vardefine: text | {{#vardefine: text | {{{3 | {{{2}}} }}} }} | ||
{{#vardefine: icon-link | {{#ifexist: File:{{#var:icon}} | {{{2}}} | File:{{#var:icon}} }} }} | {{#vardefine: icon-link | {{#ifexist: File:{{#var:icon}} | {{{2}}} | File:{{#var:icon}} }} }} | ||
{{#vardefine: icon-caption | {{#ifexist: File:{{#var:icon}} | {{#var:text}} | (Missing Icon) }} }} | {{#vardefine: icon-caption | {{#ifexist: File:{{#var:icon}} | {{#var:text}} | (Missing Icon) }} }} | ||
Line 8: | Line 8: | ||
{{#vardefine: max-w | {{{w|}}} }} | {{#vardefine: max-w | {{{w|}}} }} | ||
{{#vardefine: max-h | {{{h | {{{size | 40}}} }}} }} | {{#vardefine: max-h | {{{h | {{{size | 40}}} }}} }} | ||
}}{{#if: {{{block|}}} | <span style="display: inline-flex; align-items: center; {{#if: {{{gap|}}} | gap: {{{gap}}}px; }}"> }}<span style="display: inline-flex; align-items: center; justify-content: center; min-width: {{#var:min-w}}px; height: {{#var:max-h}}px;">{{icon | {{#var:icon}} | link = {{#var:icon-link}} | caption = {{#var:icon-caption}} | w = {{#var:max-w}} | h = {{#var:max-h}} }}</span> [[ {{#var:link}} | {{#var:text}} ]]{{#if: {{{block|}}} | </span> }}</includeonly><noinclude> | }}{{#if: {{{block|}}} | <span style="display: inline-flex; align-items: center; {{#if: {{{gap|}}} | gap: {{{gap}}}px; }}"> }}<span style="display: inline-flex; align-items: center; justify-content: center; min-width: {{#var:min-w}}px; height: {{#var:max-h}}px;">{{icon | {{#var:icon}} | link = {{#var:icon-link}} | caption = {{#var:icon-caption}} | w = {{#var:max-w}} | h = {{#var:max-h}} }}</span> [[ {{#var:link}} |{{#var:text}}]]{{#if: {{{block|}}} | </span> }}</includeonly><noinclude> | ||
Usage: {{code|<nowiki>{{IconLink | Flourish Icon.png | Flourish }}</nowiki>}} | Usage: {{code|<nowiki>{{IconLink | Flourish Icon.png | Flourish }}</nowiki>}} | ||
Revision as of 04:01, 21 August 2023
Usage: {{IconLink | Flourish Icon.png | Flourish }}
Result: Flourish
The link text can be changed with a third parameter:
Usage: {{IconLink | Flourish Icon.png | Flourish | Custom Text }}
Result: Custom Text
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: Flourish
Usage: {{IconLink | size = 25 | Flourish Icon.png | Flourish | Custom Text }}
Result: Custom Text
Behavior on missing icon:
File:Missing Icon 123.png Custom Text
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 | |
---|---|
Attack Roll | The roll you make to determine whether an attack hits an enemy at all. |
Damage Roll | The roll you make to determine the amount of damage done by a successful attack. |
Saving Throw | The roll you make to attempt avoiding various threats other than direct attacks. |
Ability Check | The roll you make when attempting anything else that requires a roll to succeed. |
Modifiers | |
Advantage | Roll the die twice, and use the higher result. Disadvantage is the exact opposite. |
Ability Score Modifier | The number you add to your rolls based on your Ability Scores. |
Proficiency Bonus | The number you add to your rolls based on whether you have Proficiency. |