GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Main page
  • Get MediaWiki
  • Get extensions
  • Tech blog
  • Contribute
  • User help
  • FAQ
  • Technical manual
  • Support desk
  • Communication
  • Developer portal
  • Code statistics
  • Community portal
  • Recent changes

This view

  • Original page
  • New address

GeezerVison is showing www.mediawiki.org — Extension:StructuredNavigation - MediaWiki

MediaWiki extensions manual
StructuredNavigation
Release status: stable
Implementation ContentHandler , Tag
Description Allows creating machine-readable navigation templates
Author(s)
  • Samantha Nguyen
Latest version 2.0.0
Compatibility policy Master maintains backward compatibility.
MediaWiki >= 1.43.0
Database changes No
Parameters
  • $wgStructuredNavigationEnableExperimentalAPI
  • $wgStructuredNavigationReservedUsername
Added rights
  • structurednav-create
  • structurednav-edit
Hooks used
  • BeforeDisplayNoArticleText
  • CodeEditorGetPageLanguage
  • ParserFirstCallInit
  • UserGetReservedNames
Licence MIT License
Download
Download extension
Git [?]:
  • Browse repository (GitHub)
  • Gerrit code review
  • Git commit log
  • Download source tarball
Translate the StructuredNavigation extension if it is available at translatewiki.net

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.)
  • 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:




link={{{link}}}
link={{{link}}}
.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 XKCD is really relevant here: https://xkcd.com/927/
  • Currently, there is no caching in place
  • There is no warning yet if you try delete a navigation and it's currently embedded on existing pages
  • As far as I know for, since the content is written in JSON:
    • It's currently impossible to add categories to the navigation page itself when it exists in the Navigation namespace.
    • all the links (as far as I know) are not tracked in the pagelinks table. This in turn, makes links in a navigation not included/considered in the following:
      • Special pages: Special:WhatLinksHere, Special:MostLinked, Special:LonelyPages, Special:DeadendPages(?), Special:Export(?), Special:WantedPages(?)
      • API modules: API:Alllinks, API:Backlinks, API:Links
  • There is no custom visual editor/UI to edit these navigations, which may pose difficulties to editors who are not familiar with JSON

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!

This extension is included in the following wiki farms/hosts and/or packages:
  • Miraheze
Retrieved from "https://www.mediawiki.org/w/index.php?title=Extension:StructuredNavigation&oldid=7650284"
Categories:
  • Stable extensions
  • ContentHandler extensions
  • Tag extensions
  • BeforeDisplayNoArticleText extensions
  • CodeEditorGetPageLanguage extensions
  • ParserFirstCallInit extensions
  • UserGetReservedNames extensions
  • MIT licensed extensions
  • Extensions in Wikimedia version control
  • All extensions
  • Extensions requiring Composer with git
  • Extensions included in Miraheze
Hidden category:
  • Extensions with master compatibility policy
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.