Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module:Other uses
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
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!
local mHatnote = require('Module:Hatnote') local mHatlist = require('Module:Hatnote list') local mArguments --initialize lazily local mTableTools --initialize lazily local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local p = {} -- Produces standard {{other uses}} implementation function p.otheruses(frame) mArguments = require('Module:Arguments') mTableTools = require('Module:TableTools') local args = mTableTools.compressSparseArray(mArguments.getArgs(frame)) local title = mw.title.getCurrentTitle().prefixedText return p._otheruses(args, {title=title}) end --Implements "other [x]" templates with otherText supplied at invocation function p.otherX(frame) mArguments = require('Module:Arguments') mTableTools = require('Module:TableTools') local x = frame.args[1] local args = mTableTools.compressSparseArray( mArguments.getArgs(frame, {parentOnly = true}) ) local options = { title = mw.title.getCurrentTitle().prefixedText, otherText = x } return p._otheruses(args, options) end -- Main generator function p._otheruses(args, options) --Type-checks and defaults checkType('_otheruses', 1, args, 'table', true) args = args or {} checkType('_otheruses', 2, options, 'table') if not (options.defaultPage or options.title) then error('No default title data provided in "_otheruses" options table', 2) end local emptyArgs = true for k, v in pairs(args) do if type(k) == 'number' then emptyArgs = false break end end if emptyArgs then args = { options.defaultPage or mHatnote.disambiguate(options.title, options.disambiguator) } end --Generate and return hatnote local text = mHatlist.forSeeTableToString({{ use = options.otherText and "other " .. options.otherText or nil, pages = args }}) return mHatnote._hatnote(text) end return p
Summary:
Please note that all contributions to Red Letter Media Wiki 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
RLMWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width