Extension:StructuredNavigation

Category:MIT licensed extensions
MediaWiki extensions manual
StructuredNavigation
Release status: stableCategory:Stable extensions
Implementation ContentHandler Category:ContentHandler extensions, Tag Category:Tag extensions
Description Allows creating machine-readable navigation templates
Author(s)
Latest version 2.0.0
Compatibility policy Master maintains backward compatibility.Category:Extensions with master compatibility policy
MediaWiki >= 1.43.0
PHP >= 7.4
Database changes No
License MIT License
Download Category:Extensions in Wikimedia version control
  • $wgStructuredNavigationEnableExperimentalAPI
  • $wgStructuredNavigationReservedUsername
  • structurednav-create
  • structurednav-edit
Quarterly downloads 1 (Ranked 100th)
Translate the StructuredNavigation extension if it is available at translatewiki.net
Category:All extensions

The StructuredNavigation extension allows users to create machine-readable navigation templates.

Installation

  • Download and move the extracted StructuredNavigation folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/StructuredNavigation
  • Only when installing from Git, run Composer to install PHP dependencies, by issuing composer install --no-dev in the extension directory. (See T173141 for potential complications.)Category:Extensions requiring Composer with git
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'StructuredNavigation' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage

You can play with an example in /docs/examples (from the source code repository). For this example, let's try using wikipedia-en-dontnod-entertainment.json.

  1. Create a new page at Navigation:Dontnod Entertainment, import the JSON into that page, then save your edit.
  2. At a separate wikitext page, add <mw-navigation title="Dontnod Entertainment"> and press save.

To customize the separator symbol, edit the MediaWiki:Structurednav-separator-symbol page.

TemplateStyle integration and customization

Guide

Example of style.css:




.mw-structurednav-navigation-container {
	background: transparent;
	border: none;
}
.mw-structurednav-header {
	background: transparent;
	font-weight: bold;
}
.mw-structurednav-header-title {
}
.mw-structurednav-groups-container {
	background: transparent;
}
.mw-structurednav-group {
	background: transparent;
}
.mw-structurednav-group-title {
	background: transparent;
	color: #a3a3c2;
	border: none;
	font-weight: bold;
	font-size: 1.25em; 
    vertical-align: text-top;
}
.mw-structurednav-group-content-list {
}
.mw-structurednav-group-content-item {
    vertical-align: text-top;
}

History

In December 2018, I thought that creating navigations were annoying, especially considering every wiki had a different way of creating those navigations. This resulted in me creating the StructuredNavigation extension. However, there are some pitfalls:

This extension is still stable and currently works. Please note that this extension is free and open source, and I only work on this extension when I have free time. However, if you like this extension and enjoy using it, or have any feedback, please let me know and post them on the discussion page. Thank you!

Category:All extensions Category:BeforeDisplayNoArticleText extensions Category:CodeEditorGetPageLanguage extensions Category:ContentHandler extensions Category:Extensions in Wikimedia version control Category:Extensions included in Miraheze Category:Extensions included in WikiForge Category:Extensions requiring Composer with git Category:Extensions with master compatibility policy Category:MIT licensed extensions Category:ParserFirstCallInit extensions Category:Stable extensions Category:Tag extensions Category:UserGetReservedNames extensions