Page MenuHomePhabricator

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, LowPublicFeature

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

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:51 AM
bzimport set Reference to bz54186.

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

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

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).

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:13 AM
Aklapper removed a subscriber: rmoen.