Server reboot imminent. Site will be down for up to 15 minutes, starting 15:00 UTC. (Current time: 14:38 UTC)

Please make sure you are not in the middle of an edit at that time, or make sure to save your work offline.

Template:IconLink: Difference between revisions

Jump to navigation Jump to search
add class
No edit summary
(add class)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{trim|
<includeonly>{{IconText
{{#vardefine: icon | {{{1}}} }}
| {{{1}}}
{{#vardefine: link | {{{2}}} }}
| {{{3|{{{2}}}}}}
{{#vardefine: text | {{{3 | {{{2}}} }}} }}
| link = {{{2}}}
{{#vardefine: min-w | {{{w | {{{size | 40}}} }}} }}
| size = {{{size|}}}
{{#vardefine: max-w | {{{w|}}} }}
| w = {{{w|}}}
{{#vardefine: max-h | {{{h | {{{size | 40}}} }}} }}
| h = {{{h|}}}
}}{{#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:link}} | caption = {{#var:text}} | w = {{#var:max-w}} | h = {{#var:max-h}} }}</span>&nbsp;[[ {{#var:link}} |{{#var:text}}]]{{#if: {{{block|}}} | </span> }}</includeonly><noinclude>
| block = {{{block|}}}
| gap = {{{gap|}}}
| nowrap = {{{nowrap|}}}
| class = {{{class|}}}
}}</includeonly><noinclude>
Usage: {{code|<nowiki>{{IconLink | Flourish Icon.png | Flourish }}</nowiki>}}
Usage: {{code|<nowiki>{{IconLink | Flourish Icon.png | Flourish }}</nowiki>}}


Line 63: Line 67:


[[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