Page MenuHomePhabricator

VisualEditor: Template dialog should make use of guessed/inferred TemplateData for templates without it
Open, LowestPublic

Description

The Visual Mode editor of Wikia is able to check all the available parameters automatically without the need for editors to edit the TemplateData for each template manually which is unrealistic to be done for over 505k templates on English Wikipedia.
However, Wikia's template editor has a severe flaw that it cannot handle a template to be included inside another template. The visual editor will deem the coding to be too complex and forcibly switch back to source mode editor.


See Also:
T54581 / T191756: Guess parameters for templates without TemplateData

Details

Reference
bz52135

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 22 2014, 1:54 AM
bzimport set Reference to bz52135.

i added a "see also" to bug 52581.

the idea is not to change anything with VE itself, but rather to teach teh TemplateData extension to return a "cookie cutter" templatedata through the API if it does not find "templatedata" tag on the template page.

this way, all existing functionality, with all the neat thing one can do with templatedata will still work, and still, VE will be usable for template editing even without it.

also, i think that programmatically, the right place to handle the issue is in the templatedata extension and not in VE itself (in addition to being cleaner and shorter code, there might be other scripts and tools that want to use the templatedata API. even if these were not a consideration, the templatedata extension is the right place to deal with templatedata shortcomings).

peace.

This is something we're unlikely to get to do soon, as it would require a vast amount of work (and, indeed, Strong AI to do properly). However, it would be a great improvement, yes.

templatewizard on hewiki implements this logic using 9 lines on JS, (so PHP should probably be able to accomplish that with no more than 50 lines). might not be perfect, but it works for a long time now, and i did not get any bug report yet.

peace.

Kipod's Template Parameter Wizard is exactly the thing I'm looking for. At least it works in Wikitext mode nicely.

It is dead easy all you need to do is scan for {{{1}}}, {{{name}}}, {{{1| {{{name| etc. I've implemented this at
http://en.wikipedia.org/wiki/User:Salix_alba/TDSkell
and there are a few other implementations about.

Kipod do you have a direct link to templatewizard as I've like to link to it?

There are 300,000 templates on the English wikipedia so many will never have their TemplateData written making this an important enhancement.

A slightly enhanced version of this request was asked at

http://en.wikipedia.org/w/index.php?title=Wikipedia_talk%3AVisualEditor&diff=574762591&oldid=573484823

in addition to just getting the names it wanted to find the "mandatory" parameters, a much harder job.

(In reply to comment #5)

Kipod do you have a direct link to templatewizard as I've like to link to it?

See bug 52581 comment 4

The transclusion UI currently requires thousands of hours to implement on each and every wiki. This is an enormous design problem that especially impacts small wikis without thousands of minions who have nothing better to do but create templatedata, so I've added this as a blocker for non-English Wikipedia (bug 51792).

(In reply to comment #6)

(In reply to comment #5)

Kipod do you have a direct link to templatewizard as I've like to link to it?

See bug 52581 comment 4

Or even
https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)/Archive_103#Template_Parameter_Wizard
mentioned on bug 39598 comment 1.

(In reply to comment #2)

This is something we're unlikely to get to do soon, as it would require a
vast
amount of work (and, indeed, Strong AI to do properly). However, it would be
a
great improvement, yes.

Indeed. It would help the newbies - not to push them to look for template page and/or template documentation and fill it slow, piece by piece. It is than much faster to add it copy&paste in wiki code, than use VE.

  • Bug 70228 has been marked as a duplicate of this bug. ***

The GUI for TemplateData can detect (or attempt to detect) parameters now. I wonder whether that could be 'borrowed' by the template tool?

The GUI for TemplateData can detect (or attempt to detect) parameters now. I wonder whether that could be 'borrowed' by the template tool?

It's not perfect, and in the GUI there is manual review involved before publication. However, from a user perspective, the only side-effect of the detection is suggestion of parameter names. Not anything beyond that. That's fairly harmless.

If we're ready to try and make this kind of detection available to users without review, then I propose to do this in the TemplateData API instead of in VisualEditor.

That way it will benefit all users of the data, not just VE. And it will keep the logic in the same repository. When VisualEditor fetches it from the API will automatically respond with either the authored data, or fallback to auto-detection for parameter keys.

Rezonansowy renamed this task from VisualEditor: VE should detect template parameters automatically instead of using hand-written TemplateData to VisualEditor: VE should detect template parameters automatically instead of using only hand-written TemplateData.Aug 7 2016, 9:10 AM
Krinkle renamed this task from VisualEditor: VE should detect template parameters automatically instead of using only hand-written TemplateData to VisualEditor: Template dialog should make use of guessed/inferred TemplateData for templates without it.May 16 2018, 9:33 PM
Krinkle updated the task description. (Show Details)