Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Humanipedia
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module:Category main article/doc
(section)
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Use from other Lua modules == Load the module: <syntaxhighlight lang="lua"> local mCatMain = require('Module:Category main article') </syntaxhighlight> You can then use the _catMain function like this: <syntaxhighlight lang="lua"> mCatMain._catMain(options, ...) </syntaxhighlight> <var>options</var> is an optional table that can be used to configure the function's output. There are two available options, "article" and "selfref". * '''article''' - if this is set to false, "no", "n", "false", or 0, the module outputs "The main page" rather than "The main article". Use the code {{code|1={article = false}|2=lua}}. * '''selfref''' - this is used when the output is a self-reference to Wikipedia. To set this option, use {{code|1={selfref = true}|2=lua}}. (See the {{tl|selfref}} template for more details on self-references.) 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 [[WP:NS|namespace]] name) is used for the first link. ; Example 1 <syntaxhighlight lang="lua"> mCatMain._catMain(nil, 'Foo') </syntaxhighlight> Produces: :<code><nowiki><div class="hatnote relarticle mainarticle">The main article for this [[Help:Categories|category]] is '''[[Foo]]'''.</div></nowiki></code> Displays as: {{cat main|Foo}} ; Example 2 <syntaxhighlight lang="lua"> mCatMain._catMain(nil, 'Foo', 'Bar', 'Baz') </syntaxhighlight> Produces: :<code><nowiki><div class="hatnote relarticle mainarticle">The main articles for this [[Help:Categories|category]] are '''[[Foo]]''', '''[[Bar]]''' and '''[[Baz]]'''.</div></nowiki></code> Displays as: {{cat main|Foo|Bar|Baz}} ; Example 3 <syntaxhighlight lang="lua"> mCatMain._catMain({article = false}, 'Foo') </syntaxhighlight> Produces: :<code><nowiki><div class="hatnote relarticle mainarticle">The main page for this [[Help:Categories|category]] is '''[[Foo]]'''.</div></nowiki></code> Displays as: {{cat main|Foo|article=no}}
Summary:
Please note that all contributions to Humanipedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Humanipedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)