Help:TemplateData/Template discovery

The template discovery features of TemplateData provide a number of ways to search for templates, for registered users to add and remove favourites, and for wiki admins to create lists of featured templates.
The features are available in WikiEditor (via TemplateWizard) and VisualEditor. They can also be integrated into other parts of MediaWiki by extension or gadget developers, via the re-usable template search widget .
Favourite templates
[edit]You must be logged in in order to mark a template as a favourite, because favourites are stored as a user preference (although it is one that is not visible in Special:Preferences).
If a template is moved , its status as a user's favourite is maintained (with the new name). If a template is deleted, and then a new template created with the same name, the favourite status is not maintained. This is because favorites are stored as page IDs , rather than page titles.
How to choose and find templates
[edit]From within the template search widget, one has these options:
- Searching by typing a keyword in the search field.
- Selecting one of the favourite templates that are stored per user in the list under the search box. While typing, one can see which matches have already been favourited and quickly access templates one used and liked in the past.
How to add and remove favourite templates
[edit]-
The favourite icon
-
The unfavourite icon
When searching from within the template widget, each search result has a 'bookmark' icon located at the end of the row. This can be clicked at any time to add or remove a template from one's favourites.
When you unfavourite a template, it does not disappear immediately from the list but is instead struck out and will only be gone completely when you close the dialog window. This is to guard against accidental removal, and the favourite button can be clicked again to restore the template to your favourites.
There are two other places from which templates can be favourited and unfavourited, both of which employ the same icons:
- In the template dialog, after selecting a template, the icon appears at the top right of the template parameter form.
- On a template page (i.e.
Template:Lorem_ipsum
), while viewing or editing. The favouriting icon is next to the watchlist icon. In some skins (e.g. MonoBook) there is no icon, but a text label instead.
How to view and edit your list of favourite templates
[edit]Your list of favourites is shown in the 'Favorites' tab when you open one of the template-insertion dialogs. From here, you can add or remove items.
Template categories
[edit]
To assist editors in finding templates, Template Discovery has a "template category browser". This allows a user to browse a list of templates which have been organised into a given category tree.
Finding a template by category
[edit]The category browser initially displays templates and categories in the local project's Category:Templates .
You can change the initial category by entering a new value in the "top-level category" input and clicking "browse". To show templates in a sub-category, select the sub-category from the list and its members will be shown. For categories with a large number of templates and/or subcategories, a "…load more" link is shown at the bottom of the column.
When you click on a template, its details will be shown in the next panel, along with a button to use it and a list of the other categories that the template is in.
Customising the template category browser
[edit]Each project can select a different initial category by changing the templatedata-category-rootcat
system message on their wiki.
When you browse to a new top-level category, your choice will be remembered by your current device and displayed next time you use the template category browser.
Featured templates
[edit]Featured templates allow a project to list a collection of templates which are likely to be useful to its editors.
Usage
[edit]These will be displayed in a list similar to the list of favourites (and in fact each featured template can also be favourited from this list, if you wish to) under the "featured" tab of the template discovery interface.
Configuration
[edit]Wiki admins can set up a list of featured templates at Special:CommunityConfiguration/TemplateData-FeaturedTemplates.
Feedback
[edit]If you have any feedback on this feature, please feel free to leave a message at this focus area's talk page.
Bugs can be reported on Phabricator.
See also
[edit]- Extension:TemplateData/Template search widget — Information for developers working with the widget.