Last modified: 2013-08-30 02:48:45 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T54754, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 52754 - TemplateData: extend data model to include a predefined set of values for a parameter ("enum"-like)
TemplateData: extend data model to include a predefined set of values for a p...
Status: RESOLVED DUPLICATE of bug 51375
Product: VisualEditor
Classification: Unclassified
Data Model (Other open bugs)
unspecified
All All
: Unprioritized enhancement
: ---
Assigned To: Ed Sanders
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-12 16:36 UTC by L736E
Modified: 2013-08-30 02:48 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description L736E 2013-08-12 16:36:04 UTC
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.
Comment 1 Ltrlg 2013-08-23 14:51:20 UTC
I think this is a duplicate of bug 51375 (Add parameter type for options)
Comment 2 James Forrester 2013-08-30 02:48:45 UTC
Merging with 51375.

*** This bug has been marked as a duplicate of bug 51375 ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links