Module:Comic books/config
From Semantic MediaWiki - Sandbox
This holds the configuration for Module:Comic books/class.
Usage
local config = mw.loadData( 'Module:Comic books/config' )
return {
-- **********************
-- * mandatory settings *
-- **********************
-- this is your type of entity
entityType = 'Comic book',
-- this is the category, the entities of the class will be put in
category = 'Comic books',
-- 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 = {
title = 'has comic book title',
['main character'] = 'has main character',
publisher = 'has comic book publisher',
writer = 'has comic book writer',
artist = 'has comic book artist',
['publication year'] = 'was published in year',
},
-- 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 = { 'main character', 'writer' },
-- these fields possibly contain more than one value
listFields = { 'main character', 'artist' },
-- separator used in list fields
delimiter = ',',
-- *********************
-- * optional settings *
-- *********************
-- the headline of the entity's page
headline = 'This is a page about a comic book',
-- 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 = 'title',
-- 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 = 'main character', label = 'Protagonist' },
{ field = 'publisher', label = 'Published by' },
{ field = 'writer', label = 'Author' },
{ field = 'artist', label = 'Artist(s)' },
{ field = 'publication year', label = 'Publication year' },
-- 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
['main character'] = 'Character',
publisher = true,
writer = 'Person',
artist = 'Person',
},
}