TemplateData provides an example field which some wikis populate. We should use that as placeholder if there is no autovalue is provided.
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Add default or example text as input placeholder | mediawiki/extensions/TemplateWizard | master | +11 -0 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | Niharika | T186653 [Epic] Template wizard for WikiEditor | |||
Resolved | Samwilson | T191268 Show "example" field from TemplateData as placeholder |
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.
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?
You can merge them. It might be confusing to users to do both. (User asks what is being show ... well, it depends.)
Change 423832 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/extensions/TemplateWizard@master] Add example text as input placeholder
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