Template:Main: Difference between revisions

From Sword of Moonlight Wiki
Jump to navigation Jump to search
Created page with "{{Rellink|extraclasses=relarticle mainarticle|{{#ifeq:{{SUBJECTSPACE}}|Category|The main {{#ifeq:{{NAMESPACE:{{{1}}}}}||article|page}}{{#if:{{{2|}}}|s}} for this [[Wikipedia:Cate..."
 
dlw>HaiFire3344
m ce
Line 1: Line 1:
{{Rellink|extraclasses=relarticle mainarticle|{{#ifeq:{{SUBJECTSPACE}}|Category|The main {{#ifeq:{{NAMESPACE:{{{1}}}}}||article|page}}{{#if:{{{2|}}}|s}} for this [[Wikipedia:Categorization|category]] {{#if:{{{2|}}}|are|is}}|Main {{#ifeq:{{NAMESPACE:{{{1}}}}}||article|page}}{{#if:{{{2|}}}|s}}:}} [[{{{1|{{PAGENAME}}}}}|{{{l1|{{{1|{{PAGENAME}}}}}}}}]]{{#if:{{{2| }}}
<includeonly><!--
|{{#if:{{{3|}}}|,&#32;|&#32;and&#32;}}[[{{{2}}}|{{{l2|{{{2}}}}}}]]}}{{#if:{{{3|}}}
-->{{#vardefine:text|<!-- start vd
|{{#if:{{{4|}}}|,&#32;|,&#32;and&#32;}}[[{{{3}}}|{{{l3|{{{3}}}}}}]]}}{{#if:{{{4|}}}
     
|{{#if:{{{5|}}}|,&#32;|,&#32;and&#32;}}[[{{{4}}}|{{{l4|{{{4}}}}}}]]}}{{#if:{{{5|}}}
  -->{{#if:{{{2|}}}<!-- if more than one page
|{{#if:{{{6|}}}|,&#32;|,&#32;and&#32;}}[[{{{5}}}|{{{l5|{{{5}}}}}}]]}}{{#if:{{{6|}}}
     
|{{#if:{{{7|}}}|,&#32;|,&#32;and&#32;}}[[{{{6}}}|{{{l6|{{{6}}}}}}]]}}{{#if:{{{7|}}}
      -->|[[{{{1}}}]]{{#if:{{{3|}}}<!-- start concat if
|{{#if:{{{8|}}}|,&#32;|,&#32;and&#32;}}[[{{{7}}}|{{{l7|{{{7}}}}}}]]}}{{#if:{{{8|}}}
       
|{{#if:{{{9|}}}|,&#32;|,&#32;and&#32;}}[[{{{8}}}|{{{l8|{{{8}}}}}}]]}}{{#if:{{{9|}}}
        -->|, [[{{{2}}}]] and [[{{{3}}}]]<!-- concat two
|{{#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>
        -->|<nowiki> </nowiki>and [[{{{2}}}]]<!-- else; concat one
           
      -->}}<!-- end concat if
       
      -->|[[{{{1}}}]]<!-- else; one page only
       
  -->}}<!-- end if
     
-->}}<!-- end vd


{{Documentation}}
-->{{Hatnote|<!--


</noinclude>
  -->{{#if:{{{2|}}}|Main articles|Main article}}: {{#var:text}}<!--
 
-->}}<!--
 
--></includeonly><!--
 
--><noinclude>{{doc}}[[Category:Hatnote templates]]</noinclude>

Revision as of 01:39, 3 August 2024

Template documentation follows
Note: the template above may sometimes be partially or fully invisible.
Visit Template:Main/doc to edit this documentation. (How does this work?)

This hatnote template is meant to be in sections of an article mentioning information about another existing main article.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Article1

A main article.

Example
Article
Page namerequired
Second Article2

A second main article.

Example
Second Article
Page nameoptional
Third Article3

A third main article.

Example
Third Article
Page nameoptional

Examples

Code Result
{{Main|Special:WantedPages}}
Main article: Special:WantedPages
{{Main|Special:WantedPages#Section Title}}
Main article: Special:WantedPages
{{Main|Special:WantedPages|Special:UncategorizedPages}}
{{Main|Special:WantedPages|Special:UncategorizedPages|Special:UncategorizedCategories}}
{{Main|Special:WantedPages{{!}}Page 1}} (Custom link label)
Main article: Page 1

Dependencies

This template requires the {{Hatnote}} metatemplate.

Source

Roughly based on Wikipedia's For Template.