WMDE Technical Wishes/Finding and inserting templates

From Meta, a Wikimedia project coordination wiki
Jump to navigation Jump to search
Finding and inserting templates
Status Deployed
Focus area Templates
Phabricator phab:T271802, phab:T272354, phab:T272355
Responsible Technical Wishes Team

This page documents the development progress of and discussions about the project Finding and inserting templates from the focus area "Make working with templates easier". You can find general information about that area and how we chose the projects in that area on this page.

We welcome comments and questions about this project on the discussion page.

Current problems[edit]

In on-wiki research and user interviews, we found that many editors encounter one big hurdle: when adding a template in VisualEditor, it’s complicated and difficult to find a template that best fits your needs. This highlights two specific problems:

1. When using template search, you already have to know which template to look for. That’s because the search is currently a prefix search: it searches through template names by their first letters and doesn’t match parts of the whole name. If you search for "dog", then a template named "Infobox Dog" will not show up in your search results. A common workaround for this limitation is to find a similar page to see which templates are used there.

2. Once you have selected a template from the search, for example, to get a preview of its appearance before deciding to add it, it’s not easy to change it. If you decide to use a different template, you can’t just return to the search; you have to fully close the “add/insert template” dialog and restart the process from the beginning. There’s also no warning that all of your changes will be lost.

Implementation[edit]

NEW search in the 2010 WikiEditor VisualEditor and 2017 wikitext editor 2010 WikiEditor (TemplateWizard)
Current template search in Visual Editor and 2017 Wikitext Editor.png Current template search TemplateWizard.png

Improved search[edit]

The changes enumerated below have been implemented for both of these dialogs: “Add a template” (VisualEditor and 2017 wikitext editor) and “Insert a template” (Template Wizard in 2010 wikitext editor).

To make it easier to find relevant templates, even if you’re not sure of an exact title:

  • The search will search the whole template name and its documentation (with CirrusSearch), not just the beginning in the exact order of letters.
  • In search results, the parts of a template name that don’t include the search term will be bolded, in order to highlight the differences between the results.
  • A search result that exactly matches the name of a template is displayed at the top of the results (unless it has already been found by CirrusSearch, in which case it already appears in the top search results anyway).

Back button and warning[edit]

The following changes have been implemented for the “Add a template” dialog in VisualEditor. To help you explore templates and find the right one for your intended use, it's now easier to go back to the search and select a new one:

  • After you select a template from the search results, the “close” button turns into a “back” button.
  • If you click the back button after entering data into the selected template, you’ll see a warning about losing the data you entered.

Further technical investigations[edit]

In the course of working on this project, community members made further requests and suggestions for improvement, and possible technical approaches were reviewed by the team:

  • Ranking of search results:
    • a ranking based on frequency of use to minimize randomness of search results.
    • greater consideration of TemplateData over the rest of the template documentation to produce more relevant results
    • prioritizing templates with TemplateData over undocumented templates to achieve more relevant results
  • Subpages in search results
    • Exclude or down-prioritize subpages such as documentation, tests, etc. from search results

Such adjustments to the search function are highly complex and require a fundamental change to the search algorithm, which the team cannot accomplish within the scope of the project. The suggestions and the results of the technical investigations will be collected and forwarded to the responsible Search Team at WMF so that they can be taken care of.

Status and next steps[edit]

  • Yes check.svg Done: July 12, 2021: Deployment on German, Greek, Malay, Twi, French, Hungarian, Turkish, Hebrew and Finnish Wikipedia and on English Wikivoyage and Nauruan Wiktionary
    • We have received feedback from these wikis, for instance whether subpages of templates should be ignored in searches. The possibilities were investigated by the team, see Further technical investigations.
  • Yes check.svg Done: March 9, 2022: Deployment on all remaining wikis except English Wikipedia
  • English Wikipedia:
    • Yes check.svg Done: March 16, 2022: back button and warning
    • Yes check.svg Done: May 17, 2022: finding and inserting templates