Wikipedia:Lua/Modul/TemplateData/Global/en

Vorlagenprogrammierung Diskussionen Lua Test Unterseiten
Modul Deutsch English Modul: Dokumentation

Using the plug-in global a multilingual documentation for an international useful standard template might be shared between projects.

The parameter set should be the same among the various wiki projects, or only slight differences might occur.

Parameters of the TemplateData formatting template

Instead of the usual parameter JSON= a special one is to be provided:

The identifier is specifying a resource in the global repository.

Furthermore necessary local adaptions may be defined by another parameter:

Global repository

Table format

The description of the entire table outlines the expected template and links to the related Wikidata entry.

Other formal components (license etc.) meet the usual habits.

The data section specifies mainly the particular template parameters.

The data schema is supposed to define most of the following fields, if required:

nametypeRemark
name string mandatory
label localized
description localized
type string
required boolean
suggested boolean
default localized
example localized
aliases string

Other than with the JSON objects implemented in MediaWiki TemplateData, where the parameters result in a set (associative, map) in arbitrary sequence, here an Array of parameter objects is used. That guarantees exactly the given order of parameters.

The following rules apply:

The parameter name |, which is impossible in template programming, has a special meaning:

Local adaptions

By the parameter Local= of the TemplateData formatting template all global settings may be overwritten locally.

The value is a JSON formatted string in the same format as parameter JSON=, but defines only properties which shall differ locally.

For the parameter list params the following special rules apply:

globallocalMeaning
string n/a Assign the remaining properties to the parameter which is globally specified by the same name value.
string string Rename that global parameter accordingly.
string false Remove this global parameter definition from local list.
n/a string Insert a local parameter at this point into list.

The sequence in Array defines order in presentation.

For the combination with definitions already present from global data the following rules apply:

Implementation

Inspiration

en:User:Yurik