Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Other uses/doc
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!
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> {{high-risk|111000+}} {{Module rating|protected}} This module produces an "other uses" hatnote for linking to disambiguation pages. It implements the {{tl|other uses}} template. == Usage from wikitext== ===otheruses()=== The <code>otheruses()</code> function directly implements {{tl|other uses}} and probably shouldn't be used anywhere else. ===otherX()=== The <code>otherX()</code> function allows direct implementation of templates that differ from {{tl|other uses}} in only phrasing. For example, where {{tl|other uses}} is phrased with "other uses", {{tl|other places}} is phrased with "other places with the same name" and can be implemented using <code>otherX()</code>, which takes the custom phrasing as its parameter at the module invocation. {{tl|other places}} in particular could be implemented with this wikitext: <syntaxhighlight lang="text">{{#invoke:other uses|otherX|places with the same name}}</syntaxhighlight> Note that the leading "other" is automatically supplied; if a template would not use this phrasing, it should not use <code>otherX()</code>. == Usage from Lua == To use this module from Lua, first load the module: <syntaxhighlight lang="lua"> local mOtheruses = require('Module:Other uses') </syntaxhighlight> The module functions can then be used through the <code>_otheruses()</code> function: <syntaxhighlight lang="lua"> mOtheruses._otheruses(args, options) </syntaxhighlight> ===Parameters of <code>_otheruses()</code>=== ;args :A table containing strings of link text, without brackets. For example, <code>{"PAGE1", "PAGE2#SECTION", "PAGE3<nowiki>|</nowiki>LABEL"}</code>. Make sure that there are no gaps or nil values, as that can confuse the <code>mw.text.listToText()</code> function the module uses. If in doubt, use <code>compressSparseArray()</code> from [[Module:TableTools]]. This may be empty or nil. ;options :A table containing a number of optional named values; you must supply at least one of <code>options.defaultPage</code> or <code>options.title</code>; in most cases setting the latter to <code>mw.title.getCurrentTitle().prefixedText</code> is advisable. The following options are supported: :*<code>defaultPage</code>: String; completely overrides the linked page when no arguments are supplied :*<code>title</code>: String; sets the title used before the "(disambiguation)" suffix. :*<code>disambiguator</code>: String; replaces "disambiguation" in the suffix :*<code>otherText</code>: String; replaces "uses" in "other uses" <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | <!-- Categories below this line, please; interwikis at Wikidata --> [[Category:Hatnote modules]] }}</includeonly>
Summary:
Please note that all contributions to Stockhub 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
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:High-risk
(
edit
)
Template:Module rating
(
edit
)
Template:Tl
(
edit
)