Page MenuHomePhabricator

Show "example" field from TemplateData as placeholder
Closed, ResolvedPublic2 Estimated Story Points

Description

TemplateData provides an example field which some wikis populate. We should use that as placeholder if there is no autovalue is provided.

Event Timeline

If you mean, pre-populate the field with the example, please don't. We don't want the examples to end up in the resulting wikitext.

If you mean, pre-populate the field with the example, please don't. We don't want the examples to end up in the resulting wikitext.

No, I mean as a placeholder.
For example:

image.png (310×976 px, 50 KB)

and when you type -
image.png (104×974 px, 14 KB)

No, I mean as a placeholder.

Ah, okay. That makes sense.

Alternately I proposed T191269: Show the default when a field is unpopulated.

No, I mean as a placeholder.

Ah, okay. That makes sense.

Alternately I proposed T191269: Show the default when a field is unpopulated.

@JJMC89 If both example and default are specified, should 'example' be shown as placeholder or 'default'? I am yet to come across a template where the templatedata contains both, so that will be an edge case. But what makes more sense to take precedence?
Also, is it okay if I merge that task here?

@JJMC89 If both example and default are specified, should 'example' be shown as placeholder or 'default'? I am yet to come across a template where the templatedata contains both, so that will be an edge case. But what makes more sense to take precedence?
Also, is it okay if I merge that task here?

You can merge them. It might be confusing to users to do both. (User asks what is being show ... well, it depends.)

Niharika set the point value for this task to 2.

Change 423832 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/extensions/TemplateWizard@master] Add example text as input placeholder

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

VE does this with placeholders for both example and default: e.g. $1 and Default: $1. Shall we do the same?

VE does this with placeholders for both example and default: e.g. $1 and Default: $1. Shall we do the same?

Does it show both if both are present?
If VE does it then I think we can do the same.

It shows default if there is one, and then example if there's no default. Doesn't show both.

I'll update the patch.

Change 423832 merged by jenkins-bot:
[mediawiki/extensions/TemplateWizard@master] Add default or example text as input placeholder

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