Page MenuHomePhabricator

Add hidden status and collapse params by default on VE
Open, Needs TriagePublicFeature

Description

Feature summary:
Some templates have parameters whose default value should rarely be changed. There should be a status in TemplateData, that hides these params from the default view, with a button to show them in the TemplateDialog UI. Possible names for this status: hidden, default-hidden, advanced, uncommon.

Use case:
An easy example for this is the 'image size' or 'logo size' parameter, found in many infoboxes on huwiki (1, 2, 3). The image size has a default value that should only be adjusted if the image breaks the infobox. This implies, that showing this parameter by default is unnecessary.

Benefits:
This would help reduce the number of parameters shown by default, displaying those that are relevant for everyone when adding a template to an article. For more experienced editors, it still keeps the hidden params within arm's reach in the UI. It may also help to keep customizable templates more consistent by keeping the default values intact and not immediately showing advanced params, like the ones used for CSS-styles.

Event Timeline

I wonder if the existing "deprecated": true is enough?

  • It hides the parameter, as requested. Unfortunately, such a parameter can only be added manually. Either in the wikitext or with the "add undocumented parameter" feature in VisualEditor.
  • When there is already a value in the parameter it's shown as normal.
  • It's possible to add explanatory text, e.g. "deprecated": "Do not use unless the default image size breaks the infobox."

Does this help?

No, deprecated doesn't seem semantically or functionally appropriate here. It signals that the parameter is outdated and shouldn't be used, whereas these are perfectly valid advanced options that should be used when needed. It can also confuse future template editors why the parameter was flagged as deprecated. A proper "advanced" or "hidden" status would communicate the right intent without confusing editors or maintainers, while also making it possible to differentiate it in the TemplateDialog UI.