Template:Main: Difference between revisions
Jump to navigation
Jump to search
WUnderhill (talk | contribs) removed erroneous CR/LF |
m Revamp as an indented Wikipedia-style section hatnote (multi-article grammar, backward compatible) |
||
| Line 1: | Line 1: | ||
<includeonly><div class="tf-hatnote" role="note">Main article{{#if:{{{2|}}}|s}}: [[{{{1}}}]]{{#if:{{{2|}}}|{{#if:{{{3|}}}|, | and }}[[{{{2}}}]]}}{{#if:{{{3|}}}|{{#if:{{{4|}}}|, | and }}[[{{{3}}}]]}}{{#if:{{{4|}}}| and [[{{{4}}}]]}}</div></includeonly><noinclude> | |||
==Purpose & Use== | ==Purpose & Use== | ||
Place '''<nowiki>{{Main}}</nowiki>''' at the very top of a section, directly under its heading, to point readers to the main article(s) on that topic — in the style of Wikipedia's hatnote. It renders an indented, italic ''Main article:'' line. | |||
==Syntax== | ==Syntax== | ||
*<nowiki>{{Main|</nowiki> | * <code><nowiki>{{Main|Article}}</nowiki></code> | ||
*<nowiki>{{Main|</nowiki>'' | * <code><nowiki>{{Main|Article#Section}}</nowiki></code> — links to a specific section | ||
* <code><nowiki>{{Main|Article 1|Article 2|Article 3|Article 4}}</nowiki></code> — up to four (renders ''Main articles: A, B, C and D'') | |||
==Examples== | ==Examples== | ||
*<code><nowiki>{{Main|Royal Manticoran Navy}}</nowiki></code> → {{Main|Royal Manticoran Navy}} | * <code><nowiki>{{Main|Royal Manticoran Navy}}</nowiki></code> → {{Main|Royal Manticoran Navy}} | ||
*<code><nowiki>{{Main|Royal Manticoran Navy#Honorverse}}</nowiki></code> → {{Main|Royal Manticoran Navy#Honorverse}} | * <code><nowiki>{{Main|Royal Manticoran Navy#Honorverse}}</nowiki></code> → {{Main|Royal Manticoran Navy#Honorverse}} | ||
* <code><nowiki>{{Main|Tenth Fleet|Royal Manticoran Navy|Grand Alliance}}</nowiki></code> → {{Main|Tenth Fleet|Royal Manticoran Navy|Grand Alliance}} | |||
==Notes== | ==Notes== | ||
Styling lives in the <code>.tf-hatnote</code> class in [[MediaWiki:Common.css]] (italic, left-indented). This is a lightweight version of Wikipedia's [https://en.wikipedia.org/wiki/Template:Main {{Main}}] hatnote; it supports up to four articles and section anchors, but not custom link labels. | |||
[[Category:Formatting]] | [[Category:Formatting]] | ||
[[Category:Lists & Indices]] | [[Category:Lists & Indices]] | ||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude> | </noinclude> | ||
Revision as of 16:01, 14 July 2026
Purpose & Use
Place {{Main}} at the very top of a section, directly under its heading, to point readers to the main article(s) on that topic — in the style of Wikipedia's hatnote. It renders an indented, italic Main article: line.
Syntax
{{Main|Article}}{{Main|Article#Section}}— links to a specific section{{Main|Article 1|Article 2|Article 3|Article 4}}— up to four (renders Main articles: A, B, C and D)
Examples
{{Main|Royal Manticoran Navy}}→Main article: Royal Manticoran Navy{{Main|Royal Manticoran Navy#Honorverse}}→Main article: Royal Manticoran Navy#Honorverse{{Main|Tenth Fleet|Royal Manticoran Navy|Grand Alliance}}→
Notes
Styling lives in the .tf-hatnote class in MediaWiki:Common.css (italic, left-indented). This is a lightweight version of Wikipedia's
] hatnote; it supports up to four articles and section anchors, but not custom link labels.