Network

Allows visualizing connections between wiki pages via an interactive network graph

On this page

External links

Network for MediaWiki

You can now visualize connections between your wiki pages with our new Network extension.

MediaWiki pages have both links to other pages (outgoing links) and other pages that link to them (incoming links). While you can get at this information via tools such as the Special:WhatLinksHere page, getting an overview of how pages are linked together is quite difficult.

Our new Network extension allows you to visualize the links for one or more wiki pages. This is done with a fancy interactive network graph. You can move nodes around, highlight connections, navigate to pages and dynamically expand the graph.

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

We thank KDZ Centre for Public Administration Research for funding initial development.

Usage documentation

Minimal example:

{{#network:}}

Example with parameters:

{{#network:Page1 | Page2 | Page3
 | class = col-lg-3 mt-0
 | exclude = Main Page ; Sitemap
}}

Parameters

Default Example value Description
(pages or pages) The current page MyPage The name of the page to show connections for. Can be specified multiple times. The parameter name is optional. Templates are supported
class col-lg-3 mt-0 Extra css class(es) to add to the network graph
exclude Sitemap ; Main Page Pages to exclude from the network graph, separated by semicolon
excludedNamespaces 2, 4, 8, 12 Namespaces to exclude from the network graph by namespace number, separated by comma
options { "nodes": { "shape": "box" } } vis.js options in JSON. Option names and text values both need to be surrounded with double quotes. Single quotes will not work. Tailing commas also do not work. Two curly brackets closes the parser function, so if you are putting the JSON directly in the parser function rather than using a template, put a tailing space or new line after each closing bracket.
enableDisplayTitle true false Should the display title rather than the page title be displayed as a node's label? Overrides the value of the $wgPageNetworkEnableDisplayTitle configuration variable.
labelMaxLength 20 30 The text length of a node's label. If the node label must be truncated, an ellipsis (…) will appended. A value of 0 indicates that the text length is not limited. Overrides the value of the $wgPageNetworkLabelMaxLength configuration variable.

There is also an includable special page, Special:Network, that can be used to construct graphs interactively. The special page presents a form that can be filled in with the same parameters listed above and submitted to render a graph. The special page can also be included in other pages for the same results as the parser function with the following modifications: the pages must be provided in a single pages parameter, and all values for the pages and exclude parameters must be separated by newlines. For example:

{{Special:Network
 | pages = Page1
 Page2
 Page3
 | class = col-lg-3 mt-0
 | exclude = Main Page Sitemap
}}

Layout CSS

The network graphs are located in a div with class network-visualization. The default css for this class is:

.network-visualization {
    width: 100%;
    height: 600px;
}

You can add extra CSS in MediaWiki:Common.css. You can also add extra classes to the div via the class parameter.

Node Icons

By default, nodes are represented by OOUI icons. This is specified in the node or group options as (excerpted from the full options):

"nodes": {
    "shape": "image"
},
"groups": {
    "bluelink": {
        "image": "resources/lib/ooui/themes/wikimediaui/images/icons/article-rtl-progressive.svg"
    },
    "redlink": {
        "image": "resources/lib/ooui/themes/wikimediaui/images/icons/articleNotFound-ltr.svg"
    },
    "externallink": {
        "image": "resources/lib/ooui/themes/wikimediaui/images/icons/linkExternal-ltr-progressive.svg"
    }
}

If version 5.1 or later of the Title Icon extension is installed and a page rendered in the graph has at least one title icon defined, one of those title icons will be used for that node's icon. If there are multiple title icons defined for the page, one will be selected in the order in which they were parsed on the page.

Examples

Options parameter

Array of vis.js options

{{#network:Page1 | Page2 | Page3
 | options=
{
    "autoResize": true,
    "nodes": {
        "color": "lightblue",
        "shape": "box",
        "borderWidth": 3,
        "font": { "color": "red", "size": 17 }
    }
}
}}

Wrong: "font.color": "red"

Right: "font": { "color": "red" }

Also right: "font": "14 px arial red"

Using templates

{{#network: {{NetworkPages}}
 | class = col-lg-3 mt-0
 | options= {{NetworkOptions}}
}}

Where NetworkPages contains Page1 | Page2 | Page3 and NetworkOptions contains { "nodes": { "shape": "box" } }

Installation

Requirements

  • PHP 7.4 or later
  • MediaWiki 1.39 or later

Load and enable

Load the extension using Composer:

COMPOSER=composer.local.json composer require --no-update professional-wiki/network:~2.0

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

wfLoadExtension( 'Network' );

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

More MediaWiki Extensions

View all our extensions

Professional MediaWiki Services

MediaWiki services by the authors of Network

Software Development icon
Software Development

Get superior results from the best MediaWiki developers with a proven track record of creating MediaWiki extensions & integrations.

Theme Development icon
Theme Development

Make your wiki look great! Use a time-tested responsive MediaWiki theme, or have us create a custom MediaWiki skin for you.

MediaWiki Hosting icon
MediaWiki Hosting

Let us take care of your wiki. We are MediaWiki hosting experts and provide cloud hosting, dedicated hosting, and on-premise hosting.

MediaWiki Consulting icon
MediaWiki Consulting

Bring your wiki to the next level by leveraging our MediaWiki expertise. From strategic planning to wikitext, we have you covered.

MediaWiki Migration icon
MediaWiki Migration

Migrate your wiki with confidence. We move your MediaWiki to a new home, or we help you migrate from another system to MediaWiki.

MediaWiki Upgrades icon
MediaWiki Upgrades

Keep your MediaWiki up-to-date and secure. We offer MediaWiki maintenance services to keep your wiki running smoothly.