This module produces hatnote saying "The main article for this category is x." It implements the template.
This module should usually be used via the template. However, it can also be used from #invoke with the syntax <nowiki>{{#invoke:Category main article|catMain|</nowiki>''parameters''<nowiki>}}</nowiki>
. Please see the template documentation for available parameters.
Load the module:
You can then use the _catMain function like this:
options is an optional table that can be used to configure the function's output. There are two available options, "article" and "selfref".
The remaining arguments are page names to be turned into link(s) following the text "The main article for this category is". If no page names are specified, the current page name (minus the namespace name) is used for the first link.
<nowiki><div class="hatnote relarticle mainarticle">The main article for this [[Help:Categories|category]] is '''[[Foo]]'''.</div></nowiki>
Displays as:<nowiki><div class="hatnote relarticle mainarticle">The main articles for this [[Help:Categories|category]] are '''[[Foo]]''', '''[[Bar]]''' and '''[[Baz]]'''.</div></nowiki>
Displays as:<nowiki><div class="hatnote relarticle mainarticle">The main page for this [[Help:Categories|category]] is '''[[Foo]]'''.</div></nowiki>
Displays as:This module uses to format the hatnote text.