Difference between revisions of "Template:Icon link"

From The Perfect Tower II
Jump to navigation Jump to search
(Created page with "[[File:{{{icon|Icon missing.png}}}|{{{size|x30px}}}|link={{{1}}}]] [[{{{1}}}|{{{txt|{{{1}}}}}}]]<noinclude> <templatedata> { "params": { "1": { "label": "Page", "desc...")
 
(Make it simpler)
Line 1: Line 1:
[[File:{{{icon|Icon missing.png}}}|{{{size|x30px}}}|link={{{1}}}]] [[{{{1}}}|{{{txt|{{{1}}}}}}]]<noinclude>
+
[[File:{{{1|Icon missing.png}}}|{{{size|x30px}}}|link={{{2}}}|alt={{{3|{{{2}}}}}}]] [[{{{2}}}|{{{3|{{{2}}}}}}]]<noinclude>
 
<templatedata>
 
<templatedata>
 
{
 
{
 
"params": {
 
"params": {
 
"1": {
 
"1": {
 +
"label": "Icon",
 +
"description": "Icon to display",
 +
"example": "Difficulty icon.png",
 +
"type": "wiki-file-name",
 +
"required": true,
 +
"default": "Icon missing.png"
 +
},
 +
"2": {
 
"label": "Page",
 
"label": "Page",
 
"description": "Page to link to",
 
"description": "Page to link to",
Line 10: Line 18:
 
"required": true
 
"required": true
 
},
 
},
"icon": {
+
"3": {
"label": "Icon",
 
"description": "Icon to display",
 
"example": "Difficulty icon.png",
 
"type": "wiki-file-name",
 
"default": "Icon missing.png",
 
"required": true
 
},
 
"txt": {
 
 
"label": "Page name",
 
"label": "Page name",
 
"description": "Text displayed instead of the page name, if different from link",
 
"description": "Text displayed instead of the page name, if different from link",
Line 35: Line 35:
 
"paramOrder": [
 
"paramOrder": [
 
"1",
 
"1",
"icon",
+
"2",
"txt",
+
"3",
 
"size"
 
"size"
 
],
 
],

Revision as of 03:41, 4 March 2021

link={{{2}}} [[{{{2}}}|{{{2}}}]]

For adding a link to a page with an icon attached

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Icon1

Icon to display

Default
Icon missing.png
Example
Difficulty icon.png
Filerequired
Page2

Page to link to

Example
Buildings
Pagerequired
Page name3

Text displayed instead of the page name, if different from link

Default
(Page link)
Example
building
Stringoptional
Icon Sizesize

Size of the icon, as a standard Mediawiki image size

Default
x30px
Example
25px
Unknownoptional