VisualEditor: If some content is selected when inserting a template, replace it with the template with the selection magically inserted as the first(?!) parameter
Open, LowPublic

Description

(Hopefully other reporters will improve the title and description if necessary!)
The French Wikipedia has a number of templates which usually ask for some kind of clarification about a whole passage of text (see https://fr.wikipedia.org/wiki/Mod%C3%A8le:Refnec#Exemples ).
So users are asking that, when they select that text and launch the template inspector, the text is already recognized as a "parameter" for that template.
Thanks.


Version: unspecified
Severity: enhancement

Details

Reference
bz54186
bzimport raised the priority of this task from to Low.
bzimport set Reference to bz54186.
Elitre created this task.Sep 16 2013, 9:33 PM
Ltrlg added a comment.Sep 16 2013, 9:39 PM

And I think that such a functionality would need to be able to remove the template by replacing it with its first parameter.

NicoV added a comment.Sep 16 2013, 9:44 PM

I think it's not only the French wiki that may use this... On English wiki, the equivalent of {{Refnec}} and its "1" parameter is {{Citation needed span}} and its "text" parameter.

Maybe a way of implementing this would be the following :

  • Add an information in TemplateData to be able to tell which parameter should be initialized with the selected text
  • When you insert a template with VE, if the TemplateData as such configuration, use the selected text to initialize the parameter
NicoV added a comment.Sep 18 2013, 4:45 PM

This feature would be very helpful for other common templates in articles. For example, the {{Colonnes}} template on French wiki, or its equivalent {{columns-list}} template on English wiki to put text/lists on several columns.

https://en.wikipedia.org/wiki/Template:Columns-list

I think a better way to solve this would be to somehow allow templates to be treated as 'annotations' in VE (like bold style or links).