imported>RheingoldRiver
Adding default set of pages
 
the mass documenting
 
Line 1: Line 1:
This creates one of the stylized and formatted links on the [[{{SITENAME}}|main page]].
'''<code>MP link</code> makes a single link (to a wiki page or an external URL) with an optional icon placed in front of the link text.'''
__TOC__


== Usage ==
== Overview ==
Groups of this template should be wrapped inside of <code><nowiki><div class="mp-links"></div></nowiki></code> and each entry should be a separate line in an [[wikipedia:Help:Lists#Basically|unordered list]]. This div can be given one of the classes <code>columns-x</code> where x is a number from 1 to 5, and the links will line up in that many columns if space permits (default is 3). The div can also optionally be given the class <code>stretch</code> and it will stretch the list vertically to fill empty space. See [[Mediawiki:Common.css]] for the full definitions of these classes and styling for this template.
This template builds one link with an optional image to its left. If you give it a wiki page name it makes an internal <code>[[link]]</code>; if you give it a full <code>http</code> URL it makes an external link instead. The optional icon links to the same target. It is used on hub pages like [[Biomes]], [[Classes]], [[Companions]] and [[Loot]] to show an image + label that both jump to the linked page.


===Parameters===
== Parameters ==
<templatedata>
{| class="wikitable"
{
! Parameter !! Required? !! What it does !! Example
    "description": {
|-
        "en": "Creates stylized and formatted links on the main page."
| <code>1</code> (first unnamed) || Required || The visible link text. Also used as the link target when <code>link=</code> is not given. || <code>Beach</code>
    },
|-
    "format": "inline",
| <code>link</code> || Optional || Where the link points. May be a wiki page title or a full <code>http(s)://</code> URL. If omitted, the target falls back to parameter <code>1</code>. || <code>Special:Random</code>
    "params": {
|-
        "1": {
| <code>image</code> || Optional || File name (with extension) of an icon shown before the text. Omit for a text-only link. || <code>BiomeSprite-Beach.png</code>
            "label": {
|-
                "en": "Text"
| <code>size</code> || Optional || Icon display size. Defaults to <code>42px</code>. || <code>92px</code>
            },
|}
            "description": {
                "en": "The text to display. If the link parameter is not given, this will also be the link target."
            },
            "required": true,
            "example": "Stuff",
            "type": "string"
        },
        "link": {
            "label": {
                "en": "Link"
            },
            "description": {
                "en": "The target page for the link, if different than the display text."
            },
            "required": false,
            "example": "Main Page",
            "type": "wiki-page-name"
        },
        "image": {
            "label": {
                "en": "Image"
            },
            "description": {
                "en": "An image to display with the link."
            },
            "required": false,
            "suggested": true,
            "type": "wiki-file-name"
        },
        "size": {
            "label": {
                "en": "Image size"
            },
            "description": {
                "en": "The size of the image, in px."
            },
            "required": false,
            "default": "42px",
            "type": "string"
        }
    },
    "paramOrder": [
        "1",
        "link",
        "image",
        "size"
    ]
}
</templatedata>


==Examples==
== How to use ==
<pre>
1. Put the label as the first value right after the template name: <code>{{MP link|Beach}}</code>. With nothing else, this both shows "Beach" and links to the page [[Beach]].
<div class="mp-links columns-3">
2. To point somewhere different from the label, add <code>link=</code>. Example: <code>{{MP link|Things|link=Special:Random}}</code> shows "Things" but jumps to a random page.
* {{MP link|Stuff|link=Special:Random|image=Site-logo.png|size=42px}}
3. <code>link=</code> understands external links automatically: if the value contains <code>http</code>, it renders as an external link; otherwise it is treated as a wiki page title.
* {{MP link|Things|link=Special:Random}}
4. To add an icon, set <code>image=</code> to a file name including its extension. The icon appears before the text and links to the same target. Adjust its size with <code>size=</code> (default 42px).
* {{MP link|Other stuff|link=Special:Random|image=Site-logo.png|size=42px}}
</div>
</pre>
Produces:
<div class="mp-links columns-3">
* {{MP link|Stuff|link=Special:Random|image=Site-logo.png|size=42px}}
* {{MP link|Things|link=Special:Random}}
* {{MP link|Other stuff|link=Special:Random|image=Site-logo.png|size=42px}}
</div>


<noinclude>
== Copy this ==
[[Category:Template documentation]]
<syntaxhighlight lang="wikitext" style="overflow:auto;">
</noinclude>
{{MP link|
|link=
|image=
|size=
}}
</syntaxhighlight>
 
== Example ==
{{MP link|Beach|image=BiomeSprite-Beach.png|size=92px}}
 
<syntaxhighlight lang="wikitext" style="overflow:auto;">
{{MP link|Beach|image=BiomeSprite-Beach.png|size=92px}}
</syntaxhighlight>
 
== Tips & notes ==
* The first unnamed parameter is doing double duty: it is both the displayed text AND the default link target. If they should differ, supply <code>link=</code>.
* <code>image</code> needs the file extension (e.g. <code>BiomeSprite-Beach.png</code>) — the template does not add <code>.png</code>.
* The image and the text are two separate links to the same destination; both are clickable.
* For an external destination, just paste the full URL into <code>link=</code> (it must contain <code>http</code> to be detected as external).
* The naming convention for biome icons on this wiki is <code>BiomeSprite-&lt;Name&gt;.png</code> (e.g. <code>BiomeSprite-CrimsonForest.png</code>).

Latest revision as of 11:55, 20 June 2026

MP link makes a single link (to a wiki page or an external URL) with an optional icon placed in front of the link text.

Overview

This template builds one link with an optional image to its left. If you give it a wiki page name it makes an internal link; if you give it a full http URL it makes an external link instead. The optional icon links to the same target. It is used on hub pages like Biomes, Classes, Companions and Loot to show an image + label that both jump to the linked page.

Parameters

Parameter Required? What it does Example
1 (first unnamed) Required The visible link text. Also used as the link target when link= is not given. Beach
link Optional Where the link points. May be a wiki page title or a full http(s):// URL. If omitted, the target falls back to parameter 1. Special:Random
image Optional File name (with extension) of an icon shown before the text. Omit for a text-only link. BiomeSprite-Beach.png
size Optional Icon display size. Defaults to 42px. 92px

How to use

1. Put the label as the first value right after the template name: Beach. With nothing else, this both shows "Beach" and links to the page Beach. 2. To point somewhere different from the label, add link=. Example: Things shows "Things" but jumps to a random page. 3. link= understands external links automatically: if the value contains http, it renders as an external link; otherwise it is treated as a wiki page title. 4. To add an icon, set image= to a file name including its extension. The icon appears before the text and links to the same target. Adjust its size with size= (default 42px).

Copy this

{{MP link|
|link=
|image=
|size=
}}

Example

Beach

{{MP link|Beach|image=BiomeSprite-Beach.png|size=92px}}

Tips & notes

  • The first unnamed parameter is doing double duty: it is both the displayed text AND the default link target. If they should differ, supply link=.
  • image needs the file extension (e.g. BiomeSprite-Beach.png) — the template does not add .png.
  • The image and the text are two separate links to the same destination; both are clickable.
  • For an external destination, just paste the full URL into link= (it must contain http to be detected as external).
  • The naming convention for biome icons on this wiki is BiomeSprite-<Name>.png (e.g. BiomeSprite-CrimsonForest.png).