This blog covers various popular and useful MediaWiki extensions. It provides information on importing data, embedding video, using maps, and much more.
MediaWiki is an extremely extensible CMS due to its architecture and backend technologies. MediaWiki extensions are collections of code and resources that can change the functionality, behavior, or appearance of the entire site or its components. The number of extensions listed on mediawiki.org is over 1,500 and growing.
The MediaWiki core is under active development. Some extensions may become incompatible with the new core as breaking changes happen quite often. Some features previously available through extensions may become part of the core and render the extension obsolete.
Extensions need to be maintained and adapted to newer versions of MediaWiki or underlying software such as PHP. Extension maintainers are people: they can be busy, lazy, or focused on other priorities. As a result, extensions can become abandoned, outdated, superseded by other extensions.
Therefore, extensions for your wiki should be chosen carefully, taking into account not only functionality, but also factors such as stability, reliable documentation, and regular maintenance. The right place to check all these aspects is the extension page on mediawiki.org.
Extensions are implementing something. If an extension does its job perfectly, it is the best one for the purpose. The WikiTeq docker image, for example, contains over a hundred handpicked extensions, extensively tested to work with the latest LTS version of MediaWiki.
For the review, we have selected extensions of a completely different scale and scope, all well documented and maintained.
By default, MediaWiki does not provide an input or form to create new pages. Instead, pages are primarily created using “red links” in other pages’ text or in search results (we have a separate blog on page creation here). This may puzzle many novice users. The InputBox is designed to fill this gap by providing input for the new page name.
It also includes creating new sections, pages in different namespaces, subpages. You can even create all of the above with preloaded content. Using inline parameters, you can change introductory texts, button labels, and text entry placeholder, as well as the position and color of input interface elements.
The PageForms extension provides a more sophisticated approach to user-driven input when creating or editing pages. It is designed to work seamlessly with MediaWiki templates and data management extensions such as SemanticMediaWiki and Cargo. Using a simple syntax and a dozen built-in input types, you can create professional-looking forms without any programming.
The hallmark of PageForms is its ability to validate user input, make fields required or restricted for a given group of users, and automatically populate field values based on namespaces, categories, concepts, and semantic property values. This helps keep your wiki clean and free of user input errors.
Imagine that all the pages in the “Animal Rights” category are created using the “Author Infobox” template. With PageForms, we can create a form for controlled filling of infobox fields and assign it as the default form for the “Animal Rights” category. This setup will add the “Edit with Form” link to any page in the category.
When used in combination with Cargo or Semantic Mediawiki, PageForms allows creating forms for querying stored data. We have a blog covering Semantic MediaWiki, Cargo, and Wikibase you can read here.
References and citations are very appropriate for encyclopedia articles. Designed as the engine for the Wikipedia project, MediaWiki provides excellent support for references building. Out of the box, you can easily add a footnote using Cite. The syntax provides options for naming, grouping, and reusing links within an article.
Depending on your needs, the extension can be configured to retrieve citation sources from the cloud using special background services and a set of handy templates and modules. You enter a DOI (ISBN, PMID or other cited work identifier) and the extension will automatically generate the necessary references.
Lingo lets you define a list of abbreviations and their definitions on a page and then displays these definitions whenever an abbreviation is hovered over in an article.
The extension provides an advanced parameters form and improves the way namespaces for a search query are selected. AdvancedSearch is a frontend to the CirrusSearch extension that uses Elasticsearch to store a text index and provide faster search results.
Standing on the shoulders of Elastic search, the extension allows you to perform full-text search by exact match, include/exclude words, support fuzzy search (with masks), and can even search separately in the page source code or in the displayed text. Results can be sorted by relevance, creation date or modification date.
EmbedVideo provides functions for embedding video clips from over 24 popular video sharing services, including YouTube, Vimeo, Twitch, Bing and others.
In the simplest case you provide the video URL as the only parameter to the function and the video can be played right on the wiki page. No uploads, no wasted disk space, no copyright complications, just a few optional parameters to play with video dimensions, players and behaviors.
Maps is a MediaWiki extension to visualize and work with geographical information. According to the extension page, it is used by NASA and thousands of other wikis.
The extension provides a wide range of settings for working with Leaflet and Google Maps maps, support for layers, custom providers, static maps, clusterization, KML and GeoJSON formats. Maps integrate nicely into Semantic MediaWiki, providing a map output format for semantic queries based on coordinates or other geodata.
The Maps come with the visual map editor that supports pins, lines, shapes, labels, etc. You can draw your map manually or import data in one of the supported formats. The extension offers parser functions for geocoding, coordinate formatting and geospatial operations.
MediaWiki is primarily a text tool, designed to work with plain text rather than structured, detailed data. The only way to analyze a corpus of articles is to assign each article to one or more categories. It's easy to see all the pages that belong to a category, but the task of selecting pages at the intersection of two or more categories is not trivial in MediaWiki.
You can add some magic and greatly enrich the user experience by introducing Semantic MediaWiki (SMW), which allows you to manage structured data in your wiki and query that data to create dynamic views: tables, timelines, maps, lists, and more.
Thanks to its simple syntax, SMW allows you to create ontologies defining the semantic properties of one of 18 data types, annotate data fragments directly in the text, manage page selection parameters, extract specific data, set rules for its sorting, formatting and pagination.
For example, in SMW it will be possible to query: "Show me a timeline displaying the name and date of birth of all composers born in Europe in the last 200 years." Or more pragmatic one: “Show me a calendar of my incomplete tasks with a due date of next week.”
SMW provides a special page for interactive query building and automatic query code generation. Once created and saved on a wiki page, the query printout will be updated every time the data changes on pages that are annotated elsewhere on the wiki.
Powerful and flexible, SemanticMediaWiki serves as a base for the whole ecosystem of extensions that make use of its data structure. Among the most notable are:
In our example with the Animal Rights category, all pages were created with some data in the Author Infobox template one by one using PageForms. DataTransfer allows you to create these pages automatically in bulk from structured data uploaded to the wiki in XML, CSV, or spreadsheet formats.
Data Transfer is designed to work with the templates and data of the given wiki. Although the extension supports XML export and import, it is recommended that you use MediaWiki's own tools to back up your wiki and move pages from one wiki to another.
The DynamicPageList3 extension is a reporting tool for MediaWiki. Unlike Semantic Media Wiki, the DPL does not add a storage subsystem, does not define namespaces, or introduces new data objects. Instead, it provides the extended syntax for listing pages, sections, template data, category members and intersections with various formats and details.
The extension configuration allows to select a level of functional richness – from modest formatting parameters to exotic and potentially dangerous batch update and delete operations (not recommended for public websites). The syntax includes debugging parameters for testing and development.
Want to bring data from IMDb, the Internet Movie Database, or from NCBI taxonomy to your wiki?
The External Data extension allows MediaWiki pages to retrieve, filter, and format structured data fromone or more sources. These sources can include external URLs and SOAP services, regular wiki pages, uploaded files, files on the local server, databases, LDAP directories and local programs output. You can even teach it to read from the current MediaWiki database!
ExternalData defines a set of unified syntax data retrieval and manipulation functions that set local variables and then display their values. With the SMW or Cargo extensions installed, External Data can store or format the retrieved data appropriately.
The ParserFunctions extension extends the wikitext parser with useful functions, mainly related to logic and string processing.
For example, you can get the length or fragment of a string, pad a string to the left or right, break a string, or replace one fragment with another. The string can be encoded or decoded from the URL format.
You can build your markup logic with conditional statements (if, ifeq, ifexist, ifexpr, switch), perform complex math operations, convert time units and format timestamps as needed, parse wiki page name structures (titleparts), and much more.
The following extensions can be combined with ParserFunctions for best results:
Some of these extensions are incompatible with plans to parallelize the parsing and may become unusable with the standard MediaWiki parser within a few years.
The Lockdown extension implements a way to restrict access to specific namespaces, special pages and page actions to a given set of user groups. This provides a more finely grained security model than the one provided by the default settings.
For example, you may want to restrict write access to the Template namespace, forbid exporting pages from your wiki or stop anonymous users from viewing page histories. Then the Lockdown is a right tool.
Note that the Lockdown extension can only be used to restrict access, not to grant it. If access is denied by some built-in setting of MediaWiki, it cannot be allowed using the Lockdown extension.
Choosing the right extension can save you a lot of time and nerves. Please read extension documentation, check user opinions, and ask the community first before implementing the extension onyour wiki. WikiTeq can recommend a set of extensions for your specific MediaWiki deployment based on the functionality you want.
There are so many great extensions around - some work out of the box, doing a simple task perfectly (like EmbedVideo), others may require some learning and practice (like DPL). To avoid common mistakes and get the best results when implementing complex solutions like Semantic MediaWiki plus SemanticResultFormats plus PageForms, we recommend hiring professionals for initial data planning and linking.
WikiTeq uses its own MediaWiki Docker Image that has over 100 popular extensions bundled into it. Feel free to reach out to us for a free consultation! We also have a lot of other useful blogs you can read here!
Here’s what we've been up to recently.