Template:Main: Difference between revisions

From TenthFleet
Jump to navigation Jump to search
WUnderhill (talk | contribs)
removed erroneous CR/LF
m nowiki the {{Main}} in the doc Notes (was rendering a stray empty hatnote)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
''Main article: [[{{{1}}}]]''<noinclude>
<includeonly><div class="tf-hatnote" role="note">Main article{{#if:{{{2|}}}|s}}: [[{{{1}}}]]{{#if:{{{2|}}}|{{#if:{{{3|}}}|,&#32;|&#32;and&#32;}}[[{{{2}}}]]}}{{#if:{{{3|}}}|{{#if:{{{4|}}}|,&#32;|&#32;and&#32;}}[[{{{3}}}]]}}{{#if:{{{4|}}}|&#32;and&#32;[[{{{4}}}]]}}</div></includeonly><noinclude>
==Purpose & Use==
==Purpose & Use==
Can be used to link to another, related article, including to a section within the article.
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 &mdash; in the style of Wikipedia's hatnote. It renders an indented, italic ''Main article:'' line.


==Syntax==
==Syntax==
*<nowiki>{{Main|</nowiki>''<<article_title>>''<nowiki>}}</nowiki>
* <code><nowiki>{{Main|Article}}</nowiki></code>
*<nowiki>{{Main|</nowiki>''<<article_title#section>>''<nowiki>}}</nowiki>
* <code><nowiki>{{Main|Article#Section}}</nowiki></code> &mdash; links to a specific section
* <code><nowiki>{{Main|Article 1|Article 2|Article 3|Article 4}}</nowiki></code> &mdash; up to four (renders ''Main articles: A, B, C and D'')


==Examples==
==Examples==
*<code><nowiki>{{Main|Royal Manticoran Navy}}</nowiki></code> &rarr; {{Main|Royal Manticoran Navy}}
* <code><nowiki>{{Main|Royal Manticoran Navy}}</nowiki></code> &rarr; {{Main|Royal Manticoran Navy}}
*<code><nowiki>{{Main|Royal Manticoran Navy#Honorverse}}</nowiki></code> &rarr; {{Main|Royal Manticoran Navy#Honorverse}}
* <code><nowiki>{{Main|Royal Manticoran Navy#Honorverse}}</nowiki></code> &rarr; {{Main|Royal Manticoran Navy#Honorverse}}
* <code><nowiki>{{Main|Tenth Fleet|Royal Manticoran Navy|Grand Alliance}}</nowiki></code> &rarr; {{Main|Tenth Fleet|Royal Manticoran Navy|Grand Alliance}}


==Notes==
==Notes==
Intended functionality similar to Wikipedia template <nowiki>>{{Main}}</nowiki>; this version is much, much more basic. The full Wikipedia <<nowiki>>{{Main}}</nowiki> template capability & syntax is available here: [https://en.wikipedia.org/wiki/Template:Main https://en.wikipedia.org/wiki/Template:Main]
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 <nowiki>{{Main}}</nowiki>] 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>

Latest revision as of 16:03, 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

Notes

Styling lives in the .tf-hatnote class in MediaWiki:Common.css (italic, left-indented). This is a lightweight version of Wikipedia's {{Main}} hatnote; it supports up to four articles and section anchors, but not custom link labels.