WMDE Technical Wishes/Templates

From Meta, a Wikimedia project coordination wiki
Jump to navigation Jump to search

Make working with templates easier[edit]

How can working with templates become easier? That's the question the Technical Wishes team at Wikimedia Germany will focus on for two years. This focus was set by the 2019 Technical Wishes Survey on German Wikipedia.

The team sets out to find solutions for different problems that people on the wikis encounter when they work with templates. Improving individual templates is not part of the project. Instead, it's about finding concepts that generally make it easier to work with templates.


Over the past months, an interdisciplinary team has intensively researched which problems and improvement requests exist in the area of templates from both the user and the technical point of view. The results are based on the following:

  • Interviews with active members of Wikimedia projects on Wikimania, WikiCon as well as remote interviews. A total of 19 interviews were conducted with users from as many different backgrounds as possible: different working methods (e.g. Visual Editor / Source Code Editor), different areas of work (use of templates / writing of templates), new and experienced contributors, from different Wikis, different origins, and of different ages and gender.
  • Evaluation of all old surveys on "TechWishes" in the German Wikipedia and their equivalents on Meta
  • Evaluation of the discussion pages for this wish, the voting page, the pages of the template- and technical workshop, as well as the help pages for templates
  • Evaluation of the problems reported at the Tech on Tour
  • Viewing of several hundred, up to 15 years old, tickets on Phabricator about MediaWiki templates and related keywords
  • A workshop about templates at WikiCon 2019 to find out more about how to work with templates
  • Exchange with the Wikimedia Foundation about its past and potential activities regarding templates

The research has revealed numerous problems and suggestions for improvement. There are two large target groups: those who work on templates and those who use them. Problem areas were identified for both target groups:

People who work on templates have problems with: People who use templates have problems with
  • the template syntax
  • insufficient developer tools
  • historically grown templates
  • Maintenance of existing templates
  • the overview and findability of templates
  • the documentation of templates
  • learning how to use templates
  • the handling of templates in the Visual Editor
  • the social values and norms that have formed around the use of templates.

Most of the problems and suggestions for improvement appeared several times and in different contexts during the research, which shows their great importance. The most frequently mentioned problems in these problem areas can be found here.

As always, feedback is welcome. For example, if you think that something has been overlooked during the research, or that other criteria should be considered for the next steps, please write to us on the discussion page.

Prototypes for Discussion[edit]

In the autumn of 2019, the team carried out comprehensive, interdisciplinary research in the subject area (see above); the result of this research is the list of problems in the subject area published here. Since then, research has been underway to determine which improvements could be implemented. To this end, numerous ideas for improvements were examined for their feasibility, effort, potential value and possible disadvantages.

Over the coming weeks, a series of simple prototypes (first draft designs) for possible projects will be published here regularly. Everyone is invited to evaluate and comment on them. For a balanced picture, feedback is sought from Wikimedians with different levels of experience, working methods and fields of activity. Based on this feedback, the Technical Wishes team will consider whether to implement the ideas, revise them again, or discard them in favor of others. Depending on the outcome of this prototyping phase, there may be another round of new ideas to provide feedback on later in the year.

Feedback on the prototypes is always welcome. However, timely feedback (within two weeks of posting) on prototypes can be used to feed directly into the development of the next prototypes.

In order to get an even deeper understanding of the issues users face, there will also be remote interviews and user tests with Wikimedians in parallel to the onwiki feedback rounds - we are still looking for volunteers! If you would like to volunteer, you can register here. Please enter the keyword "templates" in the comment field.

Important: Since we want to present new prototypes regularly in the coming weeks and we don't want to flood users' inboxes, we ask all interested people to watch this page.

1. Prototype: Featured Templates and Search Filters[edit]

This proposal consists of two parts: Search filters to find templates and the introduction of “featured templates”. The aim of this proposal is to address the frequently mentioned need for better "overview and findability of templates". This proposal should make it easier for Wikimedians to find the right template without searching through other articles for a suitable one to copy and paste.

Search filter for templates[edit]

Both the Visual Editor and the TemplateWizard in the Wikitext Editor currently have a simple input field with auto-completion to select the desired template. At the moment templates can only be easily added here if you know the exact name of the template you want to insert. We plan to extend this to a search with filter options, so that it is easier to find the desired template. Through the filters, the search results can be narrowed by type of template (infobox, source, etc.) or by subject area (biographies, animals, etc.).

Featured templates[edit]

The second part of this proposal is the introduction of featured templates, following the example of featured articles, list and images. As with these, the criteria and processes of designating templates as ‘featurable’ are in the hands of the community. The featured templates would be shown more prominently in the search described above and suggested to users. The designation of featured templates could provide an incentive to improve existing templates instead of creating new alternatives.

The animation below shows a rough draft where you can see how these two features could work together. At the current stage the emphasis is not on the implementation details, but whether these ideas are worth pursuing further.

When the user clicks on "Insert template" in the Visual Editor a modal window opens. In this window, it is possible to search for featured templates filtered by category and type. A more detailed, larger version of this could be found on a new special page.


We are looking forward to any kind of feedback. Do you think these two suggestions are suitable to simplify the process of finding the right template and would this make your work easier? Should we follow up on these suggestions? If possible, please tell us if you consider yourself more of a template user or template creator and more of a newcomer or a power user.

Please leave the Feedback here.

Thank you for the valuable feedback on the two parts of the first prototype as well as the numerous other ideas, suggestions and comments. We won't pursue the idea of featured templates, but will continue looking into ideas related to findability. We will be sharing another prototype about the latter for additional feedback. We appreciate all the suggestions, many of which coincide with our research, which makes us confident that we will end up with projects that will take Wikipedia and its sister projects forward.

Prototype 2: Improve Syntax Highlighting[edit]

Since 2018, the Wikitext editor includes syntax highlighting. This feature displays the source code with different colors, backgrounds and text styling according to their category. This should help the reader to understand the code and to orientate themselves better in the source code. Syntax highlighting can be used in both the article namespace and the template namespace (and most others). So it can help both when editing and using templates. But in more complex situations - especially when working with nested templates and when editing complex templates - the current syntax highlighting reaches its limits. In these prototypes, the aim is therefore to improve this function. We have five suggestions for this, which are roughly sketched below. As with all prototypes in this project, these are sketches of the ideas we want to hear your opinion about. Not all ideas will necessarily be implemented.

Prototype 2a: Active section highlighting and elimination of other background highlighting[edit]

Active section highlighting and elimination of other background highlighting

Currently, syntax highlighting colors the text background if the text is within a template or a so-called ParserFunction. When working on templates or editing pages with many nested templates, this can lead to almost all text being highlighted, thus creating confusion instead of clarity. This suggestion is therefore to not color the background of these texts in general and instead only highlight the innermost function or template in which the cursor is currently located. In the graphic, the cursor is located at the selected position within the 'if' function, so the entire area of this 'if' function is highlighted with a red background. This makes it easier to see what belongs together both as someone writing code and as someone looking to understand what another user has written.

Prototype 2b: Bracket matching[edit]

Bracket matching

The template syntax is known for its many curly brackets. Since templates, template variables and parser functions use different numbers of curly brackets, it can be difficult to identify which brackets belong together when developing templates or when using nested templates. Many source code editors and IDEs outside of the Wikimedia projects have a "bracket matching" function for this problem: If the cursor is next to an opening bracket, the corresponding closing bracket is highlighted and vice versa. Ideally, the functionality could also be extended so that not only the single associated bracket is highlighted, but all brackets belonging together are highlighted. In the sketch, for example, the cursor next to a closing parenthesis and thus the four curly brackets that form the beginning and end of the 'if' function are highlighted.

Prototype 2c: Bracket closing[edit]

Typing curly brackets varies in complexity depending on the keyboard. In order to be able to type faster and not forget closing brackets, another known function from development environments could be built in: if you type an opening brace, the closing brace is automatically inserted and the cursor is placed between the brackets. For example, if you type {{{, you automatically get {{{{|}}} and the cursor is in the middle of the brackets, so you can continue typing the name of the variable. In implementation, there would be a way to toggle the function on and off.

Demonstration of how white space highlighting could help working with templates

Prototype 2d: Highlight whitespace that affects formatting[edit]

Depending on the context, spaces and line breaks in the wikitext may or may not affect the rendered page. Especially when editing templates, it is often difficult to see what effects whitespaces have. An extension of syntax highlighting could mark spaces and line breaks that affect formatting. For example ¶ for line breaks and · for spaces could be used, shown in subtle colors. In implementation, there would be a way to toggle the function on and off.

Prototype 2e: Update styling rules and color theme[edit]

Not all current colors are meeting accessibility standards, the two blues are not easily distinguishable, and when all colors combine it’s not always the easiest on the eyes. We completed a study on each of the colors, adjusting to meet contrast requirements for accessibility. The category colors would stay fundamentally the same - variables would stay orange and templates would stay purple - but small changes could improve the contrast, especially for people with color vision deficiencies. Colors would be adjusted for contrast and the background could be adjusted for optimum readability.


We would like feedback from any users familiar with template syntax, whether you are comfortable writing it from scratch or if you only rarely use nested templates or edit templates. Please leave your feedback on the discussion page.

  • Would you find these changes helpful?
  • How would it impact your interactions with templates?
  • Which proposal are you most excited about?

Status and next Steps[edit]

The status of the work in this thematic focus is always visible on this page. Furthermore, important milestones are also communicated to a broader audience. As always, work on this topic will be carried out in close cooperation with the German-speaking communities.

  • Yes check.svg Done Research of problem areas
  • Currently: First ideas for solutions are presented. Feedback is wanted.
  • Following: Start of development work

What are your experiences with templates?[edit]

How do you currently work with templates, which problems do you encounter – or why don't you use templates? We're inviting everyone to share their experiences, no special expertise is needed.

There are different ways to do this:

  • If you're up to take part in a remote interview with our UX team, please fill out this form. This will add you to a list of people potentially interested in interviews. Of course you can be removed from the list at any time if you wish so.
  • If you prefer writing your experiences down, please do so on this talk page. The more descriptive, the better.


As always, feedback is very welcome. The best place for it is the talk page.