Modul:Navbox person
| This module depends on the following other modules: |
This module implements the {{Navbox person}} template. Please see the template page for usage instructions.
Usage
{{#invoke:Navbox person|navbox}}
local p = {}
local YesNo = require( 'Module:Yesno' )
processArguments = function ( args )
local processedArguments = {}
if args.clan and string.length(args.clan) > 0 then
processedArguments.clan = clan
end
if args.coterie and string.length(args.coterie) > 0 then
processedArguments.coterie = YesNo( args.coterie, true )
end
return processedArguments
end
getData = function ()
local SmwUtil = require('Module:SmwUtil')
local query = {
select = { '[[is_member_of_class::Person]]' },
fields = { 'is_of_character_type=type', 'is_member_of_the_coterie=coterie', 'is_member_of_clan=clan' }
}
local attributes = {
sort = 'has display title',
order = 'asc',
mainlabel = 'name'
}
return SmwUtil.ask(query, attributes)
-- returns data as follows
-- clan : (string) clan; WARNING: OPTIONAL
-- type : (string) person type; Vampire, Kithain, etc.
-- name : (string) pagename
-- coterie : (bool) member of the coterie; WARNING: OPTIONAL
end
processData = function ( data, args )
end
function p.main(frame)
local args = getArgs(frame)
args = processArguments( args )
local data = p.getData()
data = p.processData( data, args )
end
return p