How To Find Modules In Mediawiki

MediaWiki modules are extensions that add new functionality to the wiki software. Modules allow you to customize and enhance your wiki’s features beyond what comes included in the base MediaWiki installation.

Modules are packaged code libraries that can hook into MediaWiki. They provide additional tools, interface changes, data storage options, and more. Administrators can install over 2,000 freely available modules depending on their needs.

Some key benefits of using modules include:

  • Adding features – You can enable complex functionality like visual editing, maps, data graphs, multimedia handling, and more through modules.

  • Lower development costs – Installing modules is easier and faster than building custom features from scratch. Modules save development time and resources.

  • Community support – Popular modules have large user bases that can help troubleshoot issues. Modules are also regularly maintained and updated.

  • Customization – Modules allow you to tailor your wiki to suit your use case by enabling only the needed features.

  • Scalability – As your needs grow, you can incrementally add modules to expand your wiki’s capabilities.

In summary, modules provide an easy and flexible way to extend MediaWiki. With a library of modules, wiki owners can create customized wikis with the required features.

Where Modules Are Stored

MediaWiki modules are stored in the extensions/ folder in the MediaWiki installation directory. This is where all add-on extensions reside.

The full filesystem path is:

/path/to/mediawiki/extensions/

Modules are stored in their subfolders within extensions/. For example:

/path/to/mediawiki/extensions/TemplateStyles/

Some modules like TemplateStyles shown above contain multiple files like CSS, JavaScript, PHP files, etc.

Modules can also be exported using MediaWiki’s built-in export tool, Special: Export. This can export a module’s code into an XML file for easy sharing and installation on other wikis.

For example, navigating to Special: Export/TemplateStyles on a wiki with TemplateStyles installed will export that extension’s code into an XML file.

The Special: Export page lists all extensions/modules on a wiki for selective exporting.

How To Find Modules In Mediawiki

There are several ways to find modules to extend MediaWiki’s functionality:

Documentation on mediawiki.org

The MediaWiki website contains extensive documentation on available modules. The Extension page lists all official and recommended extensions, while the Developer hub covers module development. The documentation details what each module does, installation instructions, configuration settings, and more.

Category: Modules

The Category: Modules page on mediawiki.org categorizes modules by function. For example, modules related to user rights, spam blocking, and editing workflows can be browsed. The category view offers a quick way to find modules for a specific purpose.

Third-party repositories

In addition to the official MediaWiki repositories, many third-party repositories host MediaWiki modules. These include GitHub organizations like MediaWiki-extensions-Peer-Review and Wikimedia. Searching on GitHub can surface less common modules not found on mediawiki.org.

Installing Modules

There are two main ways to install modules in MediaWiki:

Using Special: Export

The Special: Export page allows installing modules directly within your wiki. Navigate to Special:Export and enter the extension name you want to install. Click the “Download” button. This will download a .xml file containing the module code.

Then go to Special: Import and upload the .xml file. Make sure to check the “Install” box before submitting. This will install the module files directly into your wiki’s extensions folder.

The Special: Export method is the easiest way to install modules, especially for beginners. It handles placing all the files in the correct locations.

Manual Installation

You can also install modules manually by downloading the code and uploading it to your server. This takes a few more steps:

  1. Download the module code as a .zip file, usually from MediaWiki.org or a third-party repository.

  2. Unzip the files to your computer.

  3. Use FTP to upload the module folder to your wiki’s extensions folder on the server.

  4. Add the following line to your LocalSettings.php file to enable the module:

    wfLoadExtension( 'ExtensionName' );

  5. Replace “ExtensionName” with the folder name of the module.

Manual installation gives you more control but requires FTP access and editing files. Overall, Special: Export is recommended for most use cases.

Configuring Modules

Once installed, a module must be configured and enabled to work properly in your MediaWiki instance. There are two main steps to configuring a module:

Enabling the Module

To enable a module, you need to add the following line to LocalSettings.php:

wfLoadExtension( 'ExtensionName' ); 

Replace ‘ExtensionName’ with the actual name of the extension.

This will load and enable the module to run when MediaWiki is started. Some modules may require additional parameters to be set in LocalSettings.php – check the documentation for required settings.

Setting Parameters

Most modules allow some customization and configuration via parameters. These are also set in LocalSettings.php.

For example, to set the limit for the number of results shown by the TemplateSandbox extension, you could add:

$wgTemplateSandboxResultLimit = 50;

The parameters available depend on the module. Refer to the documentation on MediaWiki.org for details on the settings specific to each extension.

Some common parameters you may want to configure include:

  • Enabling/disabling specific features of a module
  • Setting limits for things like results, revisions, etc.
  • Providing API keys or credentials
  • Configuring file paths, URLs, databases, etc.

Properly configuring parameters is important so the module integrates smoothly with your wiki. Take time to understand what options are available.

Popular Modules

Some of the most popular and widely used modules in MediaWiki include:

Template documentation

The Template documentation module adds syntax highlighting and formatting to template documentation pages. This makes reading and understanding templates much easier by clearly showing template code samples. Some features include:

  • Syntax highlighting
  • Parameter descriptions
  • Output preview
  • Categorization

ImportJS

ImportJS allows importing data from external JSON APIs into wiki pages using a simple tag syntax. For example, ImportJS can pull in content from sources like YouTube, Twitter, etc.

Scribunto

Scribunto is a framework for embedding scripting languages like Lua into wiki pages. It allows creation complex modules and templates by writing code that generates wiki markup.

VisualEditor

VisualEditor provides a visual editing interface for wiki pages instead of editing wikitext code directly. It makes editing more accessible for new users by providing a word processor-like experience.

These modules add powerful extra functionality to MediaWiki, including templates, importing data, scripting, and editing. They showcase the flexibility and customization available through modules.

Use Cases

Modules can add all sorts of functionality to a MediaWiki installation. Here are some common use cases:

Syntax Highlighting

One popular use of modules is to enable syntax highlighting for code blocks. The SyntaxHighlight GeSHi module allows the coloring and styling of source code in many languages like PHP, CSS, JavaScript, Python, etc. It parses code blocks and applies CSS styling to elements like keywords, strings, and numbers to make it more readable.

The UniversalLanguageSelector module works alongside it to auto-detect the language and apply highlighting without needing language tags. This improves the experience for developers and users posting code snippets.

Importing Templates/Content

The ImportArticles module allows importing articles from another wiki or XML files. This is useful for migrating content or templates from one MediaWiki instance to another.

Similarly, the ImportFreeImages module can pull Creative Commons-licensed images from Wikimedia Commons into your wiki database. This seeds your wiki with free illustrations that can be used in articles out of the box.

Enhancing Editing Experience

Modules like VisualEditor, CodeEditor, and Template Wizard help enhance the editing experience in MediaWiki. VisualEditor provides a WYSIWYG interface for editing pages. CodeEditor adds syntax highlighting and other IDE features for source editing. TemplateWizard guides users through inserting templates correctly.

These editor-focused modules make editing pages more intuitive for newcomers and experienced users. They demonstrate how modules can modify and enhance core MediaWiki functionality.

Best Practices For Working With MediaWiki

When working with MediaWiki modules, keep these best practices in mind:

Performance Considerations

  • Only enable modules you need. Unused modules can impact performance.
  • Check requirements for memory, CPU, and PHP versions. Make sure your server meets them.
  • Monitor performance after enabling new modules. Check page load times, memory usage, etc.
  • Cache modules that do intensive processing. Caching can improve performance dramatically.
  • Batch database writes where possible instead of running 1 query per edit.

Staying Up-to-Date

  • Keep modules updated to the latest stable version for security and bug fixes.
  • Review release notes when updating to see if configuration changes are needed.
  • Test updates on a development/staging wiki first before updating production.

Reporting Issues

  • Check the module documentation for help troubleshooting issues.
  • Search existing bug reports and forum discussions for potential solutions.
  • When reporting a new issue, provide reproducing steps, wiki version, logs, and screenshots.
  • You may need to downgrade the module for critical issues until a fix is available.

Conclusion

Installing modules is a great way to extend the functionality of your MediaWiki install. We covered what modules are, where to find them, how to install and configure them, and some popular examples.

Modules let you add features to MediaWiki without modifying core code. They are stored in the extensions/ folder or can be installed via Special: Export. The MediaWiki website lists many modules to browse through. You enable modules in LocalSettings.php and set parameters there too. Some useful modules are VisualEditor, Scribunto, and ImportJS.

With modules, you can add syntax highlighting, import templates or content, and enhance user editing experience. Take care when adding modules so as not to impact performance too much. Keep modules up to date and report any issues you find.

To learn more, check out the MediaWiki documentation on installing extensions. The extension directory also has details on specific modules. With this knowledge, you should feel empowered to find and install modules to take your wiki to the next level!