Template:Main: Difference between revisions
From Halopedia, the Halo wiki
No edit summary |
m (Text replacement - "|{{{l{{#var:key}}|{{#var:value}}}}}]]" to "|{{#ifeq:{{#sub:{{#var:value}}|0|1}}|/|{{FULLPAGENAME}}}}{{{l{{#var:key}}|{{#var:value}}}}}]]") |
||
Line 1: | Line 1: | ||
<includeonly>:''{{#if:{{{see|}}}|See also|Main article{{#if:{{{2|}}}|s}}}}: {{#sub:{{#fornumargs:key|value|[[{{{w{{#var:key}}|{{{wiki|}}}}}}:{{#ifeq:{{#sub:{{#var:value}}|0|1}}|/|{{FULLPAGENAME}}}}{{#var:value}}|{{{l{{#var:key}}|{{#var:value}}}}}]], <nowiki/>}}|0|-2}}</includeonly><noinclude> __NOTOC__ | <includeonly>:''{{#if:{{{see|}}}|See also|Main article{{#if:{{{2|}}}|s}}}}: {{#sub:{{#fornumargs:key|value|[[{{{w{{#var:key}}|{{{wiki|}}}}}}:{{#ifeq:{{#sub:{{#var:value}}|0|1}}|/|{{FULLPAGENAME}}}}{{#var:value}}|{{#ifeq:{{#sub:{{#var:value}}|0|1}}|/|{{FULLPAGENAME}}}}{{{l{{#var:key}}|{{#var:value}}}}}]], <nowiki/>}}|0|-2}}</includeonly><noinclude> __NOTOC__ | ||
== Usage == | == Usage == | ||
To link to a "main article" on a topic, use <code><nowiki>{{Main|Title of other article}}</nowiki></code>. | To link to a "main article" on a topic, use <code><nowiki>{{Main|Title of other article}}</nowiki></code>. |
Revision as of 13:34, February 14, 2023
Usage
To link to a "main article" on a topic, use {{Main|Title of other article}}
.
Advanced usage (multiple main articles)
For multiple main articles, use {{Main|Main Article 1|Main Article 2}}
.
Advanced usage (changing a link's name)
You may want the main article's name to show up differently; named parameters are good for the job.
{{Main |1=Main Article 1 |l1=Link Title 1 |2=Main Article 2 |l2=Link Title 2 }}
Note that the named parameters are a lowercase "L" and a number, not the number 1 and then another number.
Advanced usage (interwiki link)
This template is also capable of linking to another wiki. Note: To link articles in Halopedia, make sure the "wiki" path is removed and make sure the links you added are accurate. wiki
refers to the interwiki prefix of the wiki. For a list of interwiki prefixes, see Special:Interwiki.
{{Main |wiki= |1= }}
Use w1=
(or any other number) to set the interwiki prefix per entry.
Example
This template also has an additional feature. Below is an example
1=
refers to the actual link.l1=
refers to an optional yet customizable title for the link.
{{Main |wiki=rvb |1=Michael J. Caboose |l1=Caboose Blue Team }}
"See also"
To change the wording from "Main article" to "See also", simply add anything in the |see=
parameters. Below is an example:
{{Main|see=1|Halo 1|Halo 2|Halo 3|Halo 4}}