Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Editing Template:Mainarticle

Template page
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
<includeonly>:<span class="noexcerpt">''{{#if:{{{text|}}}|{{{text}}}|Main article{{#if:{{{2|}}}|s}}}}&#58; [[{{{1}}}]]{{#if:{{{2|}}}|{{#if:{{{3|}}}|,| and}} [[{{{2}}}]]}}{{#if:{{{3|}}}|{{#if:{{{4|}}}|,| and}} [[{{{3}}}]]}}{{#if:{{{4|}}}|{{#if:{{{5|}}}|,| and}} [[{{{4}}}]]}}{{#if:{{{5|}}}|, and [[{{{5}}}]]}}''{{#if:{{{6|}}}|&#32;<span class="error">(Error: Too many parameters)</span>}}</span></includeonly><noinclude>
<includeonly>
:''Main article{{#if:{{{2|}}}|s}}&#58; [[{{{1}}}]]{{#if:{{{2| }}}
  |{{#if:{{{3|}}}|,&#32;|&#32;and&#32;}}[[{{{2}}}]]}}{{#if:{{{3|}}}
  |{{#if:{{{4|}}}|,&#32;|,&#32;and&#32;}}[[{{{3}}}]]}}{{#if:{{{4|}}}
  |{{#if:{{{5|}}}|,&#32;|,&#32;and&#32;}}[[{{{4}}}]]}}{{#if:{{{5|}}}
  |, and [[{{{5}}}]]}}''{{#if:{{{6| }}}|&#32; (Error Too many parameters in &#123;&#123;{{tl|mainarticle}}&#125;&#125;)}}</includeonly><noinclude>
= Documentation =
= Documentation =
When articles become too large, subarticles are usually created. This template creates a standardized link back to the parent article(s).
When articles become too large, subarticles are usually created. This template, used in the subarticle, uses the name of the main article as a parameter to produce a link to the main article.


== Usage ==
== Usage ==
<pre>
<pre>
{{mainarticle|Article 1}}
{{mainarticle
  |Article 1
}}
</pre>
</pre>


=== Custom Preamble ===
You may also include additional links, up to five in total:
You can customize the introductory text using the `|text=` parameter. When using a custom preamble, the template will not automatically append an "s" for multiple links:
<pre>
{{mainarticle|Article 1|Article 2|text=Further information}}
</pre>


You may include up to five articles in total:
<pre>
<pre>
{{mainarticle|Article 1|Article 2|Article 3|Article 4|Article 5}}
{{mainarticle
  |Article 1
  |Article 2
  |Article 3
  |Article 4
  |Article 5
}}
</pre>
</pre>


== Example ==
== Example ==
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
! Code !! Result
! Code
|-
! Result
| <pre>{{mainarticle|Article}}</pre> || :''Main article: [[Article]]''
|- style="vertical-align:top;"
|-
| <pre>{{mainarticle|Article}}</pre>
| <pre>{{mainarticle|Article 1|Article 2|text=Further information}}</pre> || :''Further information: [[Article 1]] and [[Article 2]]''
| {{mainarticle|Article}}
|-
|- style="vertical-align:top;"
| <pre>{{mainarticle|Article1|Article2|Article3}}</pre> || :''Main articles: [[Article1]], [[Article2]] and [[Article3]]''
| <pre>{{mainarticle|Article1|Article2|Article3}}</pre>
| {{mainarticle|Article1|Article2|Article3}}
|- style="vertical-align:top;"
| <pre>{{mainarticle|Article1|Article2|Article3|Article4|Article5}}</pre>
| {{mainarticle|Article1|Article2|Article3|Article4|Article5}}
|}
|}


[[Category:Templates using ParserFunctions]]
[[Category:Templates using ParserFunctions|{{PAGENAME}}]]
[[Category:Infoline]]
[[Category:Infoline|{{PAGENAME}}]]
[[fr:Modèle:Article principal]]
</noinclude>
</noinclude>

To protect the wiki against automated edit spam, please solve the following captcha:

Cancel Editing help (opens in new window)

  [] · [[]] · [[|]] · {{}} · · “” ‘’ «» ‹› „“ ‚‘ · ~ | ° &nbsp; · ± × ÷ ² ³ ½ · §
     [[Category:]] · [[:File:]] · [[Special:MyLanguage/]] · <code></code> · <nowiki></nowiki> <code><nowiki></nowiki></code> · <syntaxhighlight></syntaxhighlight> · <includeonly></includeonly> · <noinclude></noinclude> · #REDIRECT[[]] · <translate></translate> · <languages/> · {{#translation:}} · <tvar|></> · {{DEFAULTSORT:}} · <categorytree></categorytree> · <div style="clear:both;"></div> <s></s>


Your changes will be visible immediately.
  • For testing, please use the sandbox instead.
  • On talk pages, please sign your comment by typing four tildes (~~~~).