Page MenuHomePhabricator

VisualEditor: Provide some kind of template suggestion in the transclusion editor
Open, LowPublicFeature

Description

Adam Cuerden says, "I believe the VE team intends to have a some one click solutions in the near future, including adding templates of your choice to a bar? Although I'd hope there'd also be a few automatic lists you could choose to pull up - cleanup templates, etc."

So, it would be really comfy for users if the template editor, beyond being able to let them select what they need by typing the name, asked "Which kind of template do you want to add?" and provided lists of the most used/popular ones, divided per set (cleanup templates, citation templates and so on).
Or just a way to store one's most used choices.
Thanks.


Version: unspecified
Severity: enhancement
See Also:
T52458: VisualEditor: Improvements to reference editing, including local wiki-specific workflows

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:07 AM
bzimport set Reference to bz53590.

Created attachment 13203
A very quick mockup for quick access buttons

One idea I've had is to use some of the empty vertical space on the right of the dialog for some quick access buttons. See attachment for a 2 minute mockup of how this might look. The labels I've used in the mockup are not necessarily the right ones, they're just ones I quickly thought of.

Either the buttons could be set to allow one-click access to certain templates, or to be drop-down lists of similar related ones. Possibly the two could be combined - click to get the top item in the list, or click and hold for a moment to open the drop down for short list (almost certainly no more than 10, probably less than that) of similar ones.

Selecting any of these would have the same effect as typing the name into the search field, selecting it, and clicking to add the template.

A second idea would be to change the transclusion editor button from a simple button to a combined button/drop down as I described above. Here you could only have a single list but it could be longer. Selecting a template from this list would load the transclusion editor with that template preloaded into it.

Some way of customising either/both lists (beyond recently used) would be useful too.

Attached:

VE_quick_access_templates_mockup.png (438×803 px, 24 KB)

The main priority is a (very limited) suggestion of quick-inserting templates when in a reference, which is bug 50458.

This is certainly a possibility, but would probably want to be context-specific (so it only suggests clean-up templates when your cursors is at the top of the page; only suggests stubs when at the bottom; etc.).

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

The more I use VE, the more I miss such a feature.

The challenge with it is that it's badly project-specific, so community editors will need an easy way to customize this list, but something like this already done for citation templates, so it should be possible for other templates as well.

This is one issue for which it's REALLY worth poking around Wikimedia projects in different languages to ask them what would they like in such a feature, and what current features they currently have that are similar to this. For example, the Hebrew Wikipedia has the Templateslist script ( https://he.wikipedia.org/wiki/MediaWiki:Templateslist.js ), which adds a dropdown with common templates to the Vector editing toolbar, and users there complain that they don't want to use VE because VE doesn't have such a list.

I'm not rushing - this requires proper research, understanding and design, but it should be somewhere in the roadmap.

It would really be appreciated in wikipedia's sister projects to have a costumizable common templates dropdown as there is with the citation tool.

I suggest that per Amire80, cross-wiki templates be made a blocker bug for this feature.

It's just too much widely duplicated work to do otherwise.

Mmm... I don't know if it's a blocker, but it is quite desirable.

@James_F, is this something a gadget could easily achieve?

@James_F, is this something a gadget could easily achieve?

It could, but I'd rather avoid people adding new things to the toolbar ad hoc. We really need a design for this that can scale.

Change 510943 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Allow popular templates to be listed in the template dialog

https://gerrit.wikimedia.org/r/510943

When we click in the insert template button we get a white pop-up where we must figure out what the correct template is. In Basque wikipedia we are using a reduced automatic templates system, so it would be very useful to have them listed just below, so you can click them and choose.

Most useful infoboxes:

  • {{biografia infotaula automatikoa}}
  • {{artelan infotaula automatikoa}} < for artworks
  • {{Eraikin infotaula automatikoa}} < buildings
  • {{Hiri orokor infotaula}} < cities
  • {{Probintzia orokor infotaula}} < administrative units up from cities
  • {{taxotaula automatikoa}} < taxobox

I think for a first pass on this we can allow wikis to define a list of most common templates on wiki, e.g.

MediaWiki:Template-directory.json
[
  "Biografia infotaula automatikoa",
  ...
]

This could then be fetched by the template dialog and show in the space below the search input:

image.png (508×516 px, 32 KB)

In the future we would probably want to make this more flexible, such as by grouping templates together, e.g.

MediaWiki:Template-directory.json
[
  {
    "group": "Infoboxes",
    "templates": [
      "Biografia infotaula automatikoa",
      ...
    ]
  }
]

which would necessitate a slightly more complex UI.

I think the first one would work.

For anyone interested working on this, the code would go in ve.ui.MWTemplatePlaceholderPage, and would need to do the following:

  1. Fetch the JSON data for the local wiki using mw.message, see ve.ui.Citoid.init.js for an example of this.
  2. Get the template descriptions for the listed templates using the API, see the request that the search box uses
  3. Append a list of mw.widgets.TitleOptionWidgets to the page

I'll give my eternal reconnaissance as a community member to whoever achieves that task. This is something we miss since a while on French Wikipedia.

Also, that task is probably a duplicate of T96710: Per-wiki customizable drop down menu for templates.

@Trizek-WMF it is similar, but this would be adding the most usual ones, as we are working with 6 automated templates that are highly used.

I think T96710 is asking for a similar feature, but adding buttons to the toolbar, not the template dialog.

Trizek-WMF moved this task from To Triage to Not ready to announce on the User-notice board.

@Whatamidoing-WMF tells me that English Wikivoyage would be a good candidate for a potential test: "they have 6 templates they use all the time". I think French Wikipedia would be a good candidate too.

Here's how it looks on my local install:

image.png (521×524 px, 46 KB)

That's the list of most popular (aka most used templates), right?

That's the list of most popular (aka most used templates), right?

No, it will be a community-curated list, defined on-wiki in a JSON message file. Otherwise you'd probably end up with useless crap like {{!}}.

This development looks good as a step forward. It's certainly better to have a cross-wiki uniform way for listing community curated things, than having local hacks on wikis.

It shouldn't be a permanent solution, however. Some problems with it that need a deeper solution. For example, "Cite" has its own whole first-class button, and all the other templates will be hidden in this new list behind Insert -> Template, even though many templates are as useful and common as Cite is. There is no good reason for this differentiation. Many templates could be first-class features like "Cite", although global templates should probably implemented first.

But still, it's a step in the right direction.

I think curating locally is a good step, as different Wikipedias have different customs on this. Basque Wikipedia, for example, has 6 main templates that would cover around 80% of articles (statistics invented now)

There is no good reason for this differentiation. Many templates could be first-class features like "Cite", although global templates should probably implemented first.

I think the distinction at the moment is that the Cite tools relate to extension functionality defined in the code, specifically templates wrapped in a <ref>, and the Citoid tool allows automatic population of those templates.

"Suggested templates" on the other hand are 100% defined on-wiki: the names of the templates to use, the implementation of the templates, and the metadata, so I think it's appropriate to think about these differently.

That said there are certainly cases on a wiki by wiki basis where it would make sense to promote certain templates to the toolbar, and that is covered by T96710.

There is no good reason for this differentiation. Many templates could be first-class features like "Cite", although global templates should probably implemented first.

I think the distinction at the moment is that the Cite tools relate to extension functionality defined in the code, specifically templates wrapped in a <ref>, and the Citoid tool allows automatic population of those templates.

Um... A lot of it actually is defined locally on the wiki and won't work without non-trivial JSON configuration that maps it to local templates.

My theory is that Cite got its own button because the English Wikipedia community, unlike most others, enforces citations very strongly, and new citations are needed in new edits all the time. Infoboxes are very common, but unlike citations they are usually inserted only once when the article is created, and VE is for some reason perceived more as a page editing tool than a page creation tool. (I don't perceive it as such, and I use VE for creating pages whenever I can, but my impression is that a lot of people don't think of VE as a page creation tool.)

"Suggested templates" on the other hand are 100% defined on-wiki: the names of the templates to use, the implementation of the templates, and the metadata, so I think it's appropriate to think about these differently.

Sure, but please do keep in mind that some day, better earlier than later, at least some templates should become global. When this finally happens, we can probably also have global JSON configuration for popular templates.

Um... A lot of it actually is defined locally on the wiki and won't work without non-trivial JSON configuration that maps it to local templates.

Yes, I'm comparing them to templates that are 100% defined on wiki.

Infoboxes are very common, but unlike citations they are usually inserted only once when the article is created

Yes, so as an editing tool, no particular template comes close to cite in terms of frequency of use (although I'm sure there are wiki-by-wiki examples where this is the case).

and VE is for some reason perceived more as a page editing tool than a page creation tool

I don't see it this way either, but edits >> creations.

I think this conversation belongs on T96710.

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