PC Gaming Shelter
An archive dedicated to preserving PC Gaming history and more

Help:Infoboxes

From PC Gaming Shelter
Revision as of 13:48, 26 March 2026 by WikiVisor (talk | contribs)

Approach

For each dataset we create:

  • a form that is responsible for the data collection and its primary validation;
  • a template that passes the collected data to the Scribunto module for further processing;
  • a module that:
  • sets the correspondence between form fields and semantic properties
  • provides a schema of the infobox
  • optionally defines the main category and footer for pages
  • passes data to helper modules that build an infobox

Properties Plan

Returns a table of data containing the form field names on the left and the corresponding semantic property name on the right, e.g.:

    -- Left                 -- Right
	['Image']               = {'Image', 'file' },
	['Has status']          = {'Has status' },
	['Plays game']          = {'Plays game', ',' },

The second optional argument for the subtable on the right is a delimiter, which indicates that the property can hold multiple values. It must match the delimiter defined in the form field configuration for lists. By default, PageForms uses a comma as the delimiter, but this can be redefined in cases where property values themselves may contain commas.

For values that are file names we should set file as argument to ensure its special processing.

Infobox Schema

The schema defines logical blocks for the infobox, like this:

local sectionMap = {
		['Cover image'] = {
			heading = '',
			template = 'Infobox/Cover',
			order = '1',
			rows = {
				'Image'
			}
		},
		['Player Info'] = {
			heading = 'Player Info',
			template = 'Infobox/Player Info',
			order = '2',
			rows = {
				'Has status',
				'Plays game',
				'Plays mod',
				'Has favorite mod'
			}
		},
		['Clans'] = {
			heading = 'Communities',
			template = 'Infobox/Clans',
			order = '3',
			rows = {
				'Communities'
			}
		},
		['Wiki'] = {
			heading = 'Wiki',
			template = 'Infobox/Wiki',
			order = '4',
			rows = {
				'Is guardian for',
				'Is mentor for',
				'Contact links'
			}
		}
	}
  • a heading for the section
  • an order that determines the section’s position in the infobox
  • a subset of rows, containing the field names to be displayed in the section
  • a template responsible for rendering the individual rows in the section

This way, one can easily understand and manage the infobox structure at a high level, share, re-use and replace data rendering templates.

Rendering templates

The purpose of the rendering templates is to allow for fine tuning the infobox row output.


Main Datasets

Game

Mod

Player

Community

Event