Difference between revisions of "Template:Main"

From War Thunder Wiki
Jump to: navigation, search
(Created page with "<includeonly>:<div class="noprint">''{{#if:{{{2|}}}|Main articles|Main article}}'': '''''[[{{{1}}}|{{{l1|{{{1}}}}}}]]'''''{{#if:{{{2| }}} |{{#if:{{{3|}}}|, |, }}...")
 
(should fix the issue with the 5th link)
Line 3: Line 3:
 
   |{{#if:{{{4|}}}|,&#32;|,&#32;}}'''''[[{{{3}}}|{{{l3|{{{3}}}}}}]]'''''}}{{#if:{{{4|}}}
 
   |{{#if:{{{4|}}}|,&#32;|,&#32;}}'''''[[{{{3}}}|{{{l3|{{{3}}}}}}]]'''''}}{{#if:{{{4|}}}
 
   |{{#if:{{{5|}}}|,&#32;|,&#32;}}'''''[[{{{4}}}|{{{l4|{{{4}}}}}}]]'''''}}{{#if:{{{5|}}}
 
   |{{#if:{{{5|}}}|,&#32;|,&#32;}}'''''[[{{{4}}}|{{{l4|{{{4}}}}}}]]'''''}}{{#if:{{{5|}}}
   |&#32;,&#32;[['''''{{{5}}}|{{{l5|{{{5}}}}}}''''']]}}{{#if:{{{6| }}}|&#32; (too many parameters for &#123;&#123;[[Template:main|main]]&#125;&#125;)}}</div></includeonly><noinclude>
+
   |&#32;,&#32;'''''[[{{{5}}}|{{{l5|{{{5}}}}}}]]'''''}}{{#if:{{{6| }}}|&#32; (too many parameters for &#123;&#123;[[Template:main|main]]&#125;&#125;)}}</div></includeonly><noinclude>
 
{{doc}}
 
{{doc}}
 
[[Category:Templates]]</noinclude>
 
[[Category:Templates]]</noinclude>

Revision as of 00:50, 8 April 2019

This template is used for formatting links to more detailed articles.

{{main
  |Article 1
}}

You can add up to five links, if required.

{{main
  |Article 1
  |Article 2
  |Article 3
}}

By default, the text of the link is set as the name of the page to which it directs. If needed, you can change the text the following way:

{{main
  |Article 1
  |Article 2
  |l1=Displayed text of link 1
  |l2=Displayed text of link 2
}}
Msg-info.png Note: The character 'l' in "l1" is a lowercase 'L', NOT a capital "i" or a "1"

The template can only link up to 5 pages. If you need to link more than 5 pages, use a second template as follows:

{{main|Article 1|Article 2|Article 3|Article 4|Article 5}}
{{main|Article 6|Article 7}}

Examples

Code Result
{{Main|Aviation}}
Main article: Aviation
{{Main|Aviation|Ground vehicles|Fleet}}
Main articles: Aviation, Ground vehicles, Fleet
{{Main|Aviation|Ground vehicles|Fleet|l1=Air|l2=Ground|l3=Navy}}
Main articles: Air, Ground, Navy