Template:Main: Difference between revisions

From Destinypedia, the Destiny 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}}}}}]]")
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
:''{{#if:{{{see|}}}|See also|Main article{{#if:{{{2|}}}|s}}}}: [[{{{1}}}|{{{l1|{{{1}}}}}}]]{{#if:{{{2| }}}
<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__
|{{#if:{{{3|}}}|,&#32;|&#32;and&#32;}}[[{{{2}}}|{{{l2|{{{2}}}}}}]]}}{{#if:{{{3|}}}
|{{#if:{{{4|}}}|,&#32;|,&#32;and&#32;}}[[{{{3}}}|{{{l3|{{{3}}}}}}]]}}{{#if:{{{4|}}}
|{{#if:{{{5|}}}|,&#32;|,&#32;and&#32;}}[[{{{4}}}|{{{l4|{{{4}}}}}}]]}}{{#if:{{{5|}}}
|{{#if:{{{6|}}}|,&#32;|,&#32;and&#32;}}[[{{{5}}}|{{{l5|{{{5}}}}}}]]}}{{#if:{{{6|}}}
|{{#if:{{{7|}}}|,&#32;|,&#32;and&#32;}}[[{{{6}}}|{{{l6|{{{6}}}}}}]]}}{{#if:{{{7|}}}
|{{#if:{{{8|}}}|,&#32;|,&#32;and&#32;}}[[{{{7}}}|{{{l7|{{{7}}}}}}]]}}{{#if:{{{8|}}}
|{{#if:{{{9|}}}|,&#32;|,&#32;and&#32;}}[[{{{8}}}|{{{l8|{{{8}}}}}}]]}}{{#if:{{{9|}}}
|{{#if:{{{10|}}}|,&#32;|,&#32;and&#32;}}[[{{{9}}}|{{{l9|{{{9}}}}}}]]}}{{#if:{{{10|}}}
|, and [[{{{10}}}|{{{l10|{{{10}}}}}}]]}}''{{#if:{{{11| }}}|&#32; (too many parameters in &#123;&#123;[[Template:main|main]]&#125;&#125;)}}<noinclude> __NOTOC__
== Usage ==
== Usage ==
To link to a "main article" on a topic, use <nowiki>{{Main|Title of other article}}</nowiki>.
To link to a "main article" on a topic, use <code><nowiki>{{Main|Title of other article}}</nowiki></code>.


=== Advanced Usage (Multiple main articles) ===
=== Advanced usage (multiple main articles) ===
For multiple main articles, use <code><nowiki>{{Main|Main Article 1|Main Article 2}}</nowiki></code>. Up to ten main articles may be listed.
For multiple main articles, use <code><nowiki>{{Main|Main Article 1|Main Article 2}}</nowiki></code>. Up to ten main articles may be listed.


=== Advanced Usage (Changing a Link's Name) ===
=== 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.
You may want the main article's name to show up differently; named parameters are good for the job.
<pre><nowiki>{{Main
<pre><nowiki>{{Main
Line 24: Line 15:
}}</nowiki></pre>
}}</nowiki></pre>
Note that the named parameters are a lowercase "L" and a number, ''not'' the number 1 and then another number.
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 Destinypedia, make sure the "wiki" path is removed and make sure the links you added are accurate. <code>wiki</code> refers to the interwiki prefix of the wiki. For a list of interwiki prefixes, see [[Special:Interwiki]].
<pre>
{{Main
|wiki=starwars
|1=Yoda
}}
</pre>
Use <code>w1=</code> (or any other number) to set the interwiki prefix per entry.
=== Example ===
This template also has an additional feature. Below is an example
*<code>1=</code> refers to the actual link.
*<code>l1=</code> refers to an optional yet customizable title for the link.
<pre>
{{Main
|wiki=starwars
|1=Yoda
|l1=Green Guy
}}
</pre>


=== "See also" ===
=== "See also" ===
To change the wording from "Main article" to "See also", simply add anything in the <code>|see=</code> parameters. Below is an example:
To change the wording from "Main article" to "See also", simply add anything in the <code>|see=</code> parameters. Below is an example:
:<code><nowiki>{{Main|see=1|Destiny 1|Destiny 2|Destiny 3|Destiny 4}}</nowiki></code>
:<code><nowiki>{{Main|see=1|Destiny 1|Destiny 2|Destiny 3|Destiny 4}}</nowiki></code>
::will create:
{{Main|see=1|Destiny 1|Destiny 2|Destiny 3|Destiny 4}}


[[Category:Templates|{{PAGENAME}}]]</noinclude>
[[Category:Templates]]</noinclude>

Latest revision as of 14:35, 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}}. Up to ten main articles may be listed.

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 Destinypedia, 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=starwars
|1=Yoda
}}

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=starwars
|1=Yoda
|l1=Green Guy
}}

"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|Destiny 1|Destiny 2|Destiny 3|Destiny 4}}