Module:Key people
From EverybodyWiki Bios & Wiki
| Alpha | This module is rated as alpha. It is ready for third-party input, and may be used on a few pages to see if problems arise, but should be watched. Suggestions for new features or changes in their input and output mechanisms are welcome. |
Usage
List 'key people' at top of page/ section. Similar to Template:see also
For example-
{{key people|Madonna (entertainer)|Michael Jackson}}
Renders-
--[[
-- This module produces a "See also: a, b and c" link. It implements the
-- template {{key people}}.
--]]
local mHatnote = require('Module:Hatnote')
local mSeeAlso = require('Module:See also')
local mArguments -- lazily initialise
local p = {}
function p.keyPeople(frame)
mArguments = require('Module:Arguments')
local args = mArguments.getArgs(frame, {parentOnly = true})
local pages = {}
for k, v in pairs(args) do
if type(k) == 'number' then
local display = args['label ' .. k] or args['l' .. k]
local page = display and
string.format('%s|%s', string.gsub(v, '|.*$', ''), display) or v
pages[#pages + 1] = page
end
end
if not pages[1] then
return mHatnote.makeWikitextError(
'no page names specified',
'Template:key people#Errors',
args.category
)
end
local options = {
altphrase = args.altphrase or 'Key people',
selfref = args.selfref
}
return mSeeAlso._seeAlso(pages, options)
end
function p._keyPeople (pages, options)
if not options.altphrase then options.altphrase = 'Key people' end
return mSeeAlso._seeAlso(pages, options)
end
--legacy aliases
p.seealso = p.keyPeople
p._seealso = p._keyPeople
return p
