Giter Site home page Giter Site logo

mw-hidesubpageparents's Introduction

Hide Subpage Parents MediaWiki Extension

About

This is an extension for MediaWiki that will hide the parents in the title of a subpage. For example, Example/Sample/Data will become Data.

Installation

  • Download this extension (grab the latest from releases)
  • Extract this extension into $mw/extensions/HideSubpageParents where $mp is that path to your MediaWiki installation
  • Add the following to $mw/LocalSettings.php:
require_once "$IP/extensions/HideSubpageParents/HideSubpageParents.php";

Usage

By default, all of your articles that are subpages will now only show the name of the subpage itself in the title. You can make this functionality optional by setting $wgHideSubpageParentsDefaultOn to false.

This extension also has two functions that can be used to modify the behavior of this extension on an article-by-article basis.

{{#showparents:[numberToShow]}}

When called without arguments, this function will show all of the parents in the title of the subpage regardless of the $wgHideSubpageParentsDefaultOn setting.

When numberToShow is set, only that many parents will be shown. For example, Example/Content/Data/2014/July combined with {{#showparents:3}} will result in the page name Content/Data/2014/July.

{{#hideparents:[numberToHide]}}

When called without arguments, this function will hide all of the parents in the title of the subpage regardless of the $wgHideSubpageParentsDefaultOn setting.

When numberToHide is set, only that many parents will be hidden. For example, Example/Content/Data/2014/September combined with {{#hideparents:3}} will result in the page name 2014/September.

Settings

There are a handful of settings available to configure this extension:

Setting Since Default Description
$wgHideSubpageParentsDefaultOn 0.1 true If this is set to false, subpages will not have their parent page titles removed by default.
$wgHideSubpageParentsMainNSOnly 0.1 true If this is set to false, parent page titles will be removed in every namespace.

Settings should go in your LocalSettings.php file after including the extension.

Example

// LocalSettings.php
// ...
require_once "$IP/extensions/HideSubpageParents/HideSubpageParents.php";

$wgHideSubpageParentsMainNSOnly = false;
// ...

mw-hidesubpageparents's People

Contributors

bharley avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.