Release status: stable
|Implementation||Page action, Search, Ajax|
|Description||Adds an extra icon to the edit form bar which simplifies the insertion of markup for page (and sections) links, categories, templates, images and media files. The user starts typing in the input box, the database is queried in the background and a list of matches is returned. The main difference to other link/category/... suggesters is the possibility to easily switch between different suggesters. Therefore only this extension is necessary to query multiple types of MediaWiki document types.|
|Author(s)||Thomas Klein (Cagey83talk)|
|Latest version||1.01 (2011-12-12)|
|License||GNU GPL, MIT-LICENSE|
|Translate the UniversalSuggester extension if it is available at translatewiki.net|
|Check usage and version matrix.|
The extension Universal Suggester adds an extra icon to the edit form bar which simplifies the insertion of markup for page (and sections) links, categories, templates, images and media files. The user starts typing in the UniversalSuggester input field, the database is queried in the background and a list of matches is returned. The main difference to other link/category/... suggesters is the possibility to easily switch between different suggesters. Therefore only this extension is necessary to query multiple types of MediaWiki documents.
This extension requires at least MediaWiki 1.13.0 and currently only works with the standard MediaWiki editor (the one with the blue button row, without any complex functionality).
To activate the suggester either click on the suggester icon (magnifying glass) in the edit toolbar or press Escape (Ctrl + Command also possible on a Mac). By default the link suggester is activated. This is also highlighted by the white background of the input field.
Switching between suggestersEdit
To switch between suggesters, input a colon (:) followed by
- a (semantic attributes - if the extension Semantic MediaWiki is installed)
- c (categories)
- i (images)
- f (files)
- l (links)
- r (transclusions)
- t (templates)
- u (users)
The input field will change its background color to mark the currently activated suggester.
By typing a few letters a list of suggestions shows up. Note: It doesn't matter if the typed text appears at the beginning of a document name or in the middle of it. There's also no case sensitivity. The user can select a result by either clicking on it or move to the selection with the arrow keys and hit the Enter key. He might also just complete his current input with one of the suggestions by moving to it with the arrow keys and hit the Tab key. This way the selection is not directly inserted into the article field. This is useful if the user wants to use extra options as described in the following section.
Using extra options on completed termsEdit
Category offer the possibility to use the
#-Char at the end of a completed entry to get specific results from that entry.
An example on that: By using the
Link-Suggester the page name SecretOfLife was found and the term is placed in the UniversalSuggester input field. If the user adds the
#-Char (having now SecretOfLife#) a new type of suggestions is displayed: the sections of that page which are also selectable and insertable.
Category-Suggester provides a list of super- and sub-categories and the
Template-Suggester a list of all possible params for this template.
Link-Suggester it is also possible to use the
#-Char in an empty input field, so that the current page is used as the basis for results. E.g. showing the page sections or the page categories.
Go to the method
UniversalSuggester.php and modify the variables
$a_suggesters (suggesters in use) and
$a_defaultNS (namespaces to check for queries) to fit your needs.
Please download the extension from SVN or unzip the zip place the files into the extensions folder:
$IP/extensions/UniversalSuggester/. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.
To install this extension, add the following to LocalSettings.php:
This extension uses the fabulous jquery library (v1.4.2). Additionally a slightly modified version of the jQuery plugin Autocomplete 1.0.2 by Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer is used.
Also many thanks to the Twoonix Software GmbH for financial support and critical feedback which helped me a lot to finally make the code public.