https://bugzilla.wikimedia.org/show_bug.cgi?id=52754
Web browser: ---
Bug ID: 52754
Summary: TemplateData: extend data model to include a
predefined set of values for a parameter ("enum"-like)
Product: VisualEditor
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: enhancement
Priority: Unprioritized
Component: Data Model
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected]
Classification: Unclassified
Mobile Platform: ---
Some templates foresee, for some parameters, a restricted choice of values
among a predefined set. Examples for that are, on it.wiki, the "Bio" template
which foresees, for the "Sesso" ("Gender") parameter only a choice between "M"
and "F". There are also other templates which foresee a larger set, but always
within a restricted choice (e.g. for automatic categorization purposes).
For such cases, it could be useful to extend the data model for the "params"
object inside the TemplateData, by adding a new attribute, e.g. "choices" with
array data type. For the "Bio" template of the example, this could boil out in
something like:
"params": {
"label":"Gender",
"type": "string",
"choices": ["M","F"] <---- proposal
}
The values defined for the "choices" attribute could then be used by the visual
rendering of VE to present the user with a drop-down menu (similar to HTML's
"<select><option> structure) listing only the allowed values, instead of a free
text input field.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l