This module produces an "other uses" hatnote for linking to disambiguation pages. It implements the template.
The otheruses
function directly implements and probably shouldn't be used anywhere else.
The otherX
function allows direct implementation of templates that differ from in only phrasing. For example, where is phrased with "other uses", is phrased with "other places with the same name" and can be implemented using otherX
, which takes the custom phrasing as its parameter at the module invocation. in particular could be implemented with this wikitext:
Note that the leading "other" is automatically supplied; if a template would not use this phrasing, it should not use otherX
.
To use this module from Lua, first load the module:
The module functions can then be used through the _otheruses
function:
_otheruses
{"PAGE1", "PAGE2#SECTION", "PAGE3<nowiki>|</nowiki>LABEL"}
. Make sure that there are no gaps or nil values, as that can confuse the mw.text.listToText
function the module uses. If in doubt, use compressSparseArray
from . This may be empty or nil.options.defaultPage
or options.title
; in most cases setting the latter to mw.title.getCurrentTitle.prefixedText
is advisable. The following options are supported:defaultPage
String; completely overrides the linked page when no arguments are supplied
title
String; sets the title used before the "(disambiguation)" suffix.
disambiguator
String; replaces "disambiguation" in the suffix
otherText
String; replaces "uses" in "other uses"