Template:IconLink: Difference between revisions

Jump to navigation Jump to search
add class
(Created page with "<includeonly>[[File:{{{1}}}| frameless | middle | link = {{{2}}} |x{{{size|40}}}px| {{{2}}} ]]{{nbts}}[[ {{{2}}} | {{{ 3 | {{{ 2 }}} }}} ]]</includeonly><noinclude> Usage: {{code|<nowiki>{{IconLink|Flourish Icon.png|Flourish}}</nowiki>}} Result: {{IconLink|Flourish Icon.png|Flourish}} The link text can be changed with a third parameter: Usage: {{code|<nowiki>{{IconLink|Flourish Icon.png|Flourish|Custom Text}}</nowiki>}} Result: {{IconLink|Flourish Icon.png|Flourish|C...")
 
(add class)
 
(28 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>[[File:{{{1}}}| frameless | middle | link = {{{2}}} |x{{{size|40}}}px| {{{2}}} ]]{{nbts}}[[ {{{2}}} | {{{ 3 | {{{ 2 }}} }}} ]]</includeonly><noinclude>
<includeonly>{{IconText
Usage: {{code|<nowiki>{{IconLink|Flourish Icon.png|Flourish}}</nowiki>}}
| {{{1}}}
| {{{3|{{{2}}}}}}
| link = {{{2}}}
| size = {{{size|}}}
| w = {{{w|}}}
| h = {{{h|}}}
| block = {{{block|}}}
| gap = {{{gap|}}}
| nowrap = {{{nowrap|}}}
| class = {{{class|}}}
}}</includeonly><noinclude>
Usage: {{code|<nowiki>{{IconLink | Flourish Icon.png | Flourish }}</nowiki>}}


Result: {{IconLink|Flourish Icon.png|Flourish}}
Result: {{IconLink | Flourish Icon.png | Flourish }}


The link text can be changed with a third parameter:
The link text can be changed with a third parameter:


Usage: {{code|<nowiki>{{IconLink|Flourish Icon.png|Flourish|Custom Text}}</nowiki>}}
Usage: {{code|<nowiki>{{IconLink | Flourish Icon.png | Flourish | Custom Text }}</nowiki>}}


Result: {{IconLink|Flourish Icon.png|Flourish|Custom Text}}
Result: {{IconLink | Flourish Icon.png | Flourish | Custom Text }}


The default size is {{code|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.
The default size is {{code|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:
An alternative value for the height can be provided via the {{code|size}} or {{code|h}} parameters, which are synonyms:


Usage: {{code|<nowiki>{{IconLink|Flourish Icon.png|Flourish|size=25}}</nowiki>}}
Usage: {{code|<nowiki>{{IconLink | size = 25 | Flourish Icon.png | Flourish }}</nowiki>}}


Result: {{IconLink|Flourish Icon.png|Flourish|size=30}}
Result: {{IconLink | size = 25 | Flourish Icon.png | Flourish }}


Usage: {{code|<nowiki>{{IconLink|Flourish Icon.png|Flourish|Custom Text|size=25}}</nowiki>}}
Usage: {{code|<nowiki>{{IconLink | size = 25 | Flourish Icon.png | Flourish | Custom Text }}</nowiki>}}


Result: {{IconLink|Flourish Icon.png|Flourish|Custom Text|size=30}}
Result: {{IconLink | size = 25 | Flourish Icon.png | Flourish | Custom Text }}
 
Behavior on missing icon:
 
{{IconLink | Missing Icon 123.png | Flourish | Custom Text | size = 30 }}
 
The width can be set via the {{code|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 {{code|block}} and {{code|gap}} parameters.  View the source of this page for usage.
 
{| class="wikitable" style="width: 50%;"
! colspan="2" | Rolls
|-
| {{IconLink | block = yes | w = 22 | h = 22 | gap = 2 | D20.png | Attack Roll }}
| The roll you make to determine whether an attack hits an enemy at all.
|-
| {{IconLink | block = yes | w = 22 | h = 22 | gap = 2 | D6 Thunder.png | Damage Roll }}
| The roll you make to determine the amount of damage done by a successful attack.
|-
| {{IconLink | block = yes | w = 22 | h = 22 | gap = 2 | Saving Throw Icon.png | Saving Throw }}
| The roll you make to attempt avoiding various threats other than direct attacks.
|-
| {{IconLink | block = yes | w = 22 | h = 22 | gap = 2 | D20.png | Ability Check }}
| The roll you make when attempting anything else that requires a roll to succeed.
|-
! colspan="2" | Modifiers
|-
| {{IconLink | block = yes | w = 22 | h = 22 | gap = 2 | Advantage_Icon.png | Advantage }}
| Roll the die twice, and use the higher result. [[Disadvantage]] is the exact opposite.
|-
| {{IconLink | block = yes | w = 22 | h = 22 | gap = 2 | Charisma Ability Icon.png | Ability Score Modifier }}
| The number you add to your rolls based on your [[Ability Scores]].
|-
| {{IconLink | block = yes | w = 22 | h = 22 | gap = 2 | Proficiency Icon.png | Proficiency Bonus }}
| The number you add to your rolls based on whether you have [[Proficiency]].
|}


[[Category:Icon Templates]]
[[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>

Navigation menu