Rules

Automate MediaWiki page categorization based on rules

Configuration UI of the Rules extension showing regional categories like DACH and Benelux being automatically applied to pages with the right country-level categories

On this page

External links

Rules for MediaWiki

Automate MediaWiki page categorization based on rules defined via a user-friendly configuration interface.

Define rules to categorize pages based on the categories they already contain. Combine conjunctions (AND) and disjunctions (OR) as needed.

For example, place all pages that are in the ISO 27001 category AND in the Policy category AND in the "Doc Status - Final" category into the ISO 27001 category, omitting any policies not yet marked as final. Or create a DACH Customers category with all pages that are in the Customers category AND in at least one of Germany, Austria, OR Switzerland.

Configuration UI of the Rules extension showing automatic categorization of ISO 27001 Policies and Procedures by only including documents in the Policy or Procedure category that are also marked as final

The first version of the extension only supports categorization based on categories. Future versions might contain additional types of conditions and actions.

Professional Wiki created Rules. We are MediaWiki developers that provide professional MediaWiki services.

Nutzungsdokumentation

Define rules via the MediaWiki:Rules page. You can find a link to this page on Special:SpecialPages. Only users with the interface-admin right can edit the rules. On standard MediaWiki, users in the sysop group have this right.

Configuration UI of the Rules extension showing automatic categorization to Critical Open Incidents, High-Severity Open Incidents, and Critical Resolved Incidents categories

Edits to rules are visible in the page version history and can thus be audited or reverted.

Automatic categorization does not change the wikitext content of pages and is applied on page save. Regular wiki users thus do not have to do anything. Categories added by rules are removed as soon as their conditions are no longer met.

After defining new rules, you might wish to automatically apply them to all pages. To do this, you must run the refreshLinks.php script. This can only be done with someone who has command-line access to the wiki. Typical command:

php maintenance/run.php refreshLinks

While the rules are shown and edited via a user-friendly user-interface, they are stored in the page as JSON. You can directly edit the JSON at your own risk, which is particularly useful when copying rules between wikis or AI-generating your initial rules based on documentation. The JSON is validated against the Rules JSON Schema.

Installation

Requirements

  • PHP 8.1 or later
  • MediaWiki 1.43 or later

Load and enable

Load the extension using Composer:

COMPOSER=composer.local.json composer require --no-update professional-wiki/rules:~1.0

Enable the extension by adding the following to your LocalSettings.php:

wfLoadExtension( 'Rules' );

You can verify the installation by checking your wiki's Special:Version page.

Konfiguration

Rules does not have any customizability via PHP configuration.

Weitere MediaWiki-Erweiterungen

View all our extensions

Professionelle MediaWiki-Dienstleistungen

MediaWiki services by the authors of Rules

Softwareentwicklung Symbol
Softwareentwicklung

Erzielen Sie hervorragende Ergebnisse mit erfahrenen MediaWiki-Entwicklern, die Erfahrung beim Entwickeln von MediaWiki-Erweiterungen und -Integrationen haben.

Theme-Entwicklung Symbol
Theme-Entwicklung

Lassen Sie Ihr Wiki großartig aussehen! Verwenden Sie ein erprobtes responsives MediaWiki-Theme oder lassen Sie uns ein individuelles MediaWiki-Skin für Sie erstellen.

MediaWiki-Hosting Symbol
MediaWiki-Hosting

Lassen Sie uns Ihr Wiki betreuen und hosten. Wir sind Experten für MediaWiki-Hosting und bieten Cloud-Hosting, dediziertes Hosting und Hosting vor Ort (On-Premises) an.

MediaWiki-Beratung Symbol
MediaWiki-Beratung

Steigern Sie Wert und Qualität Ihres Wikis, indem Sie unsere MediaWiki-Expertise nutzen. Von der Planung bis zur konkreten Implementierung haben wir alles im Griff.

MediaWiki-Migration Symbol
MediaWiki-Migration

Wechseln Sie sorglos zu einem neuen Hosting. Wir migrieren Ihr MediaWiki auf einen neuen Server, oder wir unterstützen Sie beim Umzug von einem anderen Wiki-System zu MediaWiki.

MediaWiki-Upgrades Symbol
MediaWiki-Upgrades

Wir sorgen dafür, dass Ihr MediaWiki auf dem neuesten Stand und geschützt bleibt. Wir bieten Wartung und Aktualisierung für MediaWiki, damit Ihr Wiki störungsfrei läuft.