TemplateData: Provide property "example" for template parameters
Closed, ResolvedPublic

Description

From
https://www.mediawiki.org/wiki/Thread:VisualEditor/Feedback/About_TemplateData

'(...) would it be possible to add new parameter "example" (where is example text what should be added to the parameter) in addition "label", "description", "type" and "required"?'


Version: unspecified
Severity: enhancement

Details

Reference
bz51049
bzimport set Reference to bz51049.
He7d3r created this task.Jul 9 2013, 5:14 PM
Stryn added a comment.Feb 25 2014, 6:32 PM

Any progress?

Jdforrester-WMF moved this task from Backlog to Next-up on the TemplateData board.Dec 2 2014, 9:16 PM
Jdforrester-WMF lowered the priority of this task from "High" to "Normal".

Change 194386 had a related patch set uploaded (by Mooeypoo):
Add an example property to parameters

https://gerrit.wikimedia.org/r/194386

Change 194416 had a related patch set uploaded (by Mooeypoo):
Show the field's example if it exists

https://gerrit.wikimedia.org/r/194416

Mooeypoo claimed this task.Mar 4 2015, 11:49 PM
Mooeypoo moved this task from Next-up to Doing on the TemplateData board.

Change 194416 merged by jenkins-bot:
MWParameterPage: Show the field's example if it exists

https://gerrit.wikimedia.org/r/194416

The feature support in MWParameterPage is a bit presumptuous as the exact definition and property name are still being reviewed upstream in TemplateData.

Anyway, this feature seems useful, but I'd like to be more explicit about at least one use case before we land it. The talk thread that requests it didn't seem to note anything about the existing properties description, default and autofill which currently cover the use case of showing what a field is for and what kind of value it should have.

I take it it will be used as placeholder in a user interface. However in VisualEditor the default is currently also displayed in the placeholder attribute. And the (already merged) conditional implementation of that does indeed ignore the example value if there is a default. And it seems there is no difference communicated to the user visually to distinguish example from default.

If the user won't be able to tell the difference, can authors?

I feel like the feature would be useful, but it is imho not sufficiently clear in its specification, implementation and current use in VisualEditor to offset it from the other existing features. And I imagine this will lead to confusion or incorrect usage by authors and users.

Change 194386 merged by jenkins-bot:
Add an example property to parameters

https://gerrit.wikimedia.org/r/194386

Checked in betalabs - 'Example (en)' was added to Template documentation editor.

Change 207123 had a related patch set uploaded (by Krinkle):
Add example property to HTML rendering

https://gerrit.wikimedia.org/r/207123

Change 207123 merged by jenkins-bot:
Add example property to HTML rendering

https://gerrit.wikimedia.org/r/207123