Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:IconLink: Difference between revisions

Template page
No edit summary
Use template demo
 
(2 intermediate revisions by the same user not shown)
Line 11: Line 11:
| class = {{{class|}}}
| class = {{{class|}}}
}}</includeonly><noinclude>
}}</includeonly><noinclude>
Usage: {{code|<nowiki>{{IconLink | Flourish Icon.png | Flourish }}</nowiki>}}
Displays a link with an icon.


Result: {{IconLink | Flourish Icon.png | Flourish }}
== Examples ==
 
{{Template demo
The link text can be changed with a third parameter:
| style = table
 
| caption 1 = Default
Usage: {{code|<nowiki>{{IconLink | Flourish Icon.png | Flourish | Custom Text }}</nowiki>}}
| <nowiki>{{IconLink | Flourish Icon.png | Flourish }}</nowiki>
 
| caption 2 = Custom link text
Result: {{IconLink | Flourish Icon.png | Flourish | Custom Text }}
| <nowiki>{{IconLink | Flourish Icon.png | Flourish | Custom Text }}</nowiki>
}}


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


Usage: {{code|<nowiki>{{IconLink | size = 25 | Flourish Icon.png | Flourish }}</nowiki>}}
{{Template demo
 
| style = table
Result: {{IconLink | size = 25 | Flourish Icon.png | Flourish }}
| <nowiki>{{IconLink | size = 25 | Flourish Icon.png | Flourish }}</nowiki>
 
| <nowiki>{{IconLink | size = 25 | Flourish Icon.png | Flourish | Custom Text }}</nowiki>
Usage: {{code|<nowiki>{{IconLink | size = 25 | Flourish Icon.png | Flourish | Custom Text }}</nowiki>}}
| <nowiki>{{IconLink | Missing Icon 123.png | Flourish | Custom Text | size = 30}}</nowiki>
 
}}
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.
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.
Line 65: Line 61:
| The number you add to your rolls based on whether you have [[Proficiency]].
| The number you add to your rolls based on whether you have [[Proficiency]].
|}
|}
[[Category:Icon templates]]


== Template parameters ==
== Template parameters ==
Line 122: Line 116:
"description": "Insert a linked icon."
"description": "Insert a linked icon."
}
}
</templatedata></noinclude>
</templatedata>
[[Category:Templates]]
[[Category:Icon templates]]
[[Category:Link templates]]
</noinclude>