Page MenuHomePhabricator

TemplateData: Be able to specify a "no parameters accepted" definition
Open, MediumPublic1 Estimated Story Points

Description

Some (many) templates do not use any parameters (e.g., hundreds of templates like https://en.wikipedia.org/wiki/Template:Stub). However, if you add those templates, VisualEditor will ask you for parameters, just like it does for any other template. It would be nice to have a TemplateData setting for "no parameters here, so don't bother asking".


Version: unspecified
Severity: enhancement

Details

Reference
bz62417

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:52 AM
bzimport added a project: TemplateData.
bzimport set Reference to bz62417.
  • This bug has been marked as a duplicate of bug 51429 ***
Whatamidoing-WMF reopened this task as Open.Jun 11 2015, 10:31 PM

I think I wasn't quite clear earlier. T53429 is about saying (nicely) that no parameters have been listed in TemplateData. I'm glad that we made that improvement, but that's not what I want here. Instead of a nice message, I want to define, in TemplateData, that this template actually does not accept or use any parameters. This is "no parameters in the template", not "no parameters currently typed into the TemplateData".

When a template is so marked, I'd also like VisualEditor disable the 'field name' search box, so that people can't insert any made-up or invalid parameters. I want TemplateData to be able to stop editors from trying to add pointless parameters.

Elitre added a subscriber: Elitre.Nov 5 2015, 12:26 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 5 2015, 12:26 PM
Jdforrester-WMF edited a custom field.
Jdforrester-WMF moved this task from To Triage to TR1: Releases on the VisualEditor board.

So maybe something like a "This TemplateData definition is complete, don't allow any undocumented parameters." (not necessarily restricted to an empty array of parameters).

I'm not sure this is a direction we want to go in though - IIRC we want to allow for TemplateData being wrong and therefore able to be overridden inside VE.

Maybe something like that, although I'd be happy to to restrict it to an empty array (=the case when it is least likely to be wrong).

Even a "warning" note would be an improvement. We could probably reduce confusion if we could have it display a sentence that says, "This template uses no parameters. It is technically possible to add parameters here, but they will be ignored by the template".

Wostr added a subscriber: Wostr.Aug 31 2016, 10:11 PM

I don't think we should have a property specifically to indicate that there are no parameters. I agree there needs to be room for TemplateData being wrong or outdated and VisualEditor's advanced transclusion editor would always allow for parameters to be added.

However I think it'd be fine to remove the ability to add parameters from the simple editor that loads by default in VisualEditor - for cases where TemplateData data did exist but had no parameters specified.

But @Krinkle why shouldn't we have a way to signal that there are no parameters in the template?

Yes, it could be wrong. There could also be incorrectly incomplete TemplateData blocks added (probably far more common, actually).

I'm not saying that you'd have to prevent the addition of parameters. But could you just tell me that adding a parameter to {{France-university-stub}} is probably a bad idea? Just a friendly note, not something that's going to break the workflow if the TemplateData is wrong. Just a note that says something like "According to the template documentation, this template doesn't normally use any parameters."

Here's another example for the list of use cases: The sole contents of
{{userboxbottom}} is the table-closing wikitext code |}. There are
dozens of similar templates on enwiki. Adding parameters to these is
pointless at best.

Deskana lowered the priority of this task from High to Medium.Oct 11 2017, 9:30 PM
Deskana moved this task from TR0: Interrupt to Freezer on the VisualEditor board.
Krinkle removed a subscriber: Krinkle.May 16 2018, 4:46 PM