Template:Form field from value definitions of property
From OpenMedia
Creates a form field based on definition values of [[allows value:: …]] set from a property page:
- it uses property: Value definitions of property and it’s internal defined objects
Usage
Without specifying a template parameter:
{{Form field from value definitions of property|Dc:language}} {{Form field from value definitions of property|Dc:language|listbox}}
Result: {{{field|Dc:language|input type=listbox|values=}}}
With named template parameters:
{{Form field from value definitions of property|property=Dc:language|input type=listbox}}
With complex settings (show also definitons as help):
{{Form field from value definitions of property|property=Dc:language|input type=listbox}}
Parameters
mandatory and optional parameters are:
- 1= or property=
- query the property that defines property:allows value defined
- 2= or input type=
- “listbox” or “dropdown” (default: dropdown)
- field=
- the form field (default: value of parameter 1= or property=)
- mandatory=
- “yes”
- default=
- default value for the form field when form is opened
- show help for=
- show additional values defined on the property page, usually the skos:prefLabel or skos:definition to have selected values explained. For instance template {{Property setting}} can define numerical values (=allows value) that have a label assigned to each numeric value, e.g.:
0=no priority; 1=lowest priority;
(“allows value” is “0” and the label is “no priority” etc.). This can be achieved as follows:|show help for=allows value, label
(creates a <span> for the form functionality “show on select“)|show help for=allows value, label, definition
(creates a <div> for the form functionality “show on select“)