Module:Person/config
De Semantic MediaWiki - Sandbox
This holds the configuration for Module:Person/class.
Usage[modifier le wikicode]
local config = mw.loadData( 'Module:Person/config' )
return {
-- **********************
-- * mandatory settings *
-- **********************
-- this is your type of entity
entityType = 'Person',
-- this is the category, the entities of the class will be put in
category = 'Persons',
-- lists all available pairs "template parameter" -> "semantic property"
-- if you want to have a field in the template without storing it semantically, set it to true
parameters = {
firstname = 'has firstname',
lastname = 'has lastname',
['date of birth'] = 'was born on',
gender = 'has gender',
profession = 'works as',
},
-- tell the class, which fields are mandatory
-- for every argument in this list not present on your page's template call,
-- an error will be displayed
mandatory = { 'firstname', 'firstname', 'gender' },
-- these fields possibly contain more than one value
listFields = { 'profession' },
-- separator used in list fields
delimiter = ',',
-- *********************
-- * optional settings *
-- *********************
-- the headline of the entity's page
headline = 'This is a page about a person',
-- INFOBOX CONFIG HERE
-- here you can disable your infobox
omitInfoBox = false,
-- this is the name of the field, used as title in the infobox
titleField = 'name',
-- this defines, which fields are put into your infobox and in which order
infoboxConfig = {
-- for every row in your infobox, add a table here, containing at least the entry "field" which
-- refers to the data field to display. if you omit the entry "label", the field will be displayed
-- over both columns
{ field = 'firstname', label = 'Firstname' },
{ field = 'lastname', label = 'Lastname' },
{ field = 'date of birth', label = 'Date of birth' },
{ field = 'gender', label = 'Gender' },
{ field = 'profession', label = 'Profession' },
-- why is this not defined as an array: lua does not maintain the order of items in an array but accesses them randomly
},
-- configure here, which fields should be linked (or form-linked)
linkFields = {
-- if a field is set to true, it will be linked
-- if it is set to a string, #formlink will be used
profession = true,
},
}