Jump to content

Extension:SubpageNavigation: Difference between revisions

From mediawiki.org
Content deleted Content added
mNo edit summary
m use neutral URLs
Line 38: Line 38:
|vagrant-role =
|vagrant-role =
}}
}}
'''SubpageNavigation''' shows a collapsible list of subpages on the header of each article, including empty articles, with subpages. By contrast to similar extensions, '''SubpageNavigation does not require to add a parser function in the wikitext''', and shows only direct children of a page. (a direct child, however, might include slashes if the parent page does not exist). It also features a [https://developer.mozilla.org/en-US/docs/Web/CSS/Layout_cookbook/Breadcrumb_Navigation breadcrumb navigation] placed above the title, and a special page where to browse all the pages of the wiki grouped by subpages, in a similar way to the GitHub file manager.
'''SubpageNavigation''' shows a collapsible list of subpages on the header of each article, including empty articles, with subpages. By contrast to similar extensions, '''SubpageNavigation does not require to add a parser function in the wikitext''', and shows only direct children of a page. (a direct child, however, might include slashes if the parent page does not exist). It also features a [https://developer.mozilla.org/docs/Web/CSS/Layout_cookbook/Breadcrumb_Navigation breadcrumb navigation] placed above the title, and a special page where to browse all the pages of the wiki grouped by subpages, in a similar way to the GitHub file manager.





Revision as of 06:11, 27 January 2024

MediaWiki extensions manual
SubpageNavigation
Release status: stable
Implementation Hook , Special page
Description Shows direct children of current page in article header and provides a special page to browse all articles with subpages of the wiki in different modalities
Author(s) thomas-topway-it (thomas-topway-ittalk)
Latest version 1.1 (2023-12-18)
Compatibility policy Master maintains backward compatibility.
MediaWiki 1.35+
License GNU General Public License 2.0 or later
Download
  • $wgSubpageNavigationShowTree
  • $wgSubpageNavigationArticleHeaderSubpagesLimit
  • $wgSubpageNavigationCacheStore
  • $wgSubpageNavigationTreeSubpagesLimit
  • $wgSubpageNavigationDefaultOptions
  • $wgSubpageNavigationDisableCache
  • $wgSubpageNavigationShowBreadcrumbs
  • $wgSubpageNavigationShowArticleHeader
  • $wgSubpageNavigationTreeShowChildrenCount
Quarterly downloads 17 (Ranked 118th)
Translate the SubpageNavigation extension if it is available at translatewiki.net

SubpageNavigation shows a collapsible list of subpages on the header of each article, including empty articles, with subpages. By contrast to similar extensions, SubpageNavigation does not require to add a parser function in the wikitext, and shows only direct children of a page. (a direct child, however, might include slashes if the parent page does not exist). It also features a breadcrumb navigation placed above the title, and a special page where to browse all the pages of the wiki grouped by subpages, in a similar way to the GitHub file manager.


After the installation the extension adds a link in the side-panel to browse all the articles of the wiki in 3 different modalities (by grouping subpages, only pages with children, and filesystem-like) and adds the features described below.



Installation

  • Download and move the extracted SubpageNavigation 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/SubpageNavigation
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'SubpageNavigation' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.


Features

Collapsible list of subpages

The extension will show in any page of your wiki with subpages an header like the following, without the need to add a parser function.

The list of subpages is also shown for non-existing articles, this is useful for instance when subpages are created in a programmatic way: however if the intermediate pages are empty, the children won't be grouped in the Special Page "Browse subpages", so it is always preferable to have an empty article for each intermediate level (unless the title itself does not contain a slash, in this case it will be handled correctly by the extension).

When the list of subpages shown on a given article exceeds a given threshold, SubpagesNavigation will display a link to the special page Browse subpages where the user can navigate the entire list of subbpages with the standard MediaWiki navigation.


When the current page has a parent page, the extension will also show a breadcrumb navigation like the following:

The breadcrumb is also shown on Special pages navigation, so the user can easily return to the list of Special pages.


This feature can be disabled setting $wgSubpageNavigationDisableBreadcrumb = true; in LocalSettings.php after loading the extension.


Special page "Browse subpages"

Since version 1.1 SubpageNavigation displays a link "Browse subpages" in the side-panel that points to a special page where the articles of the wiki can be navigated in 3 different modalities (by grouping subpages, only pages with children, and filesystem-like).



The navigation panel allows to switch mode, between "standard", "folders", and "filesystem": the first mode will display articles with subpages and articles without subpages together, but will group the articles with subpages. The second mode, "folders" will display only articles with children, and the mode "filesystem" will display first the articles with children and then the articles without children.



A future version of the extension might feature a hierarchical navigation using Ajax, however the current panel allows to navigate among a large number of articles using the standard Mediawiki navigation, and this is the key feature of SubpageNavigation.


Global parameters

variable description default
$wgSubpageNavigationArticleHeaderSubpagesThreshold max number of subpages shown in the article header 20
$wgSubpageNavigationDisableBreadcrumb Disable breadcrumb navigation false


Known issues

Currently breadcrumb is disabled for the Vector-2022 skin. This because the breadcrumb is currently inserted within the Page status indicators, and it seems that there is no way on such skin to manually display the indicators above the title using PHP.


Support & bugs

Please post error messages in the Talk page of the extension.


Roadmap

  • hierarchical navigation performed through Ajax, optionally shown in the side-panel and in the special page "Browse subpages".


See also

  • SubPageList - Allows to list and count subpages.
  • Subpage Fun - Defines some new parser functions to get advanced information about subpages.