Extension:SubPageFunctions

The SubPageFunctions extension automatically creates subpage links in parent page.

When creating a tree of subpages, this extension will provide navigation links from a parent page to its immediate subpages. It is the counterpart to the wiki's parent page links.

You may slice and dice subpage names to select parts of the name using the pathname function.

When compiling educational documents, you may create a table linking to them, using the calendar function.

The user function returns the current user name, useful when creating personalised pages.

subpages
The syntax is Where  NAMESPACE is an optional namespace name, e.g. Project, Help, MyNamespace, etc. 0 (numerical zero) is the main namespace, often called Article. 

The default is to use the page's namespace, so you can omit the argument. You may use the function more than once for different namespaces.

You may add the function anywhere on the page. It will create a centered title and a three column list of subpage links. If there are no subpages, the function will output nothing.

pathname
The syntax is Where  start An integer representing the first component in the pathname. length</dt> An integer representing the number of components.</dd> </dl> The pathname can be trimmed from both the front or back. The length is similarly selected from either the front or back.

Given the page name

It only operates on the current page name in a similar way to and , so you cannot pass it arbitary text. It becomes useful when using more than three subpage levels.

calendar
The syntax is Where  namespace</dt> The namespace of the target pages.</dd> pageprefix</dt> The parent page in the namespace.</dd> </dl> Returns a table where the columns are subpages of pageprefix and the rows are sub-subpages of pageprefix. If pageprefix is omitted, the current page name is used. If the namespace is omitted, the current page's namespace is used.

Given the following pages: the function in the Extension:SubPageFunctions page will produce the following table: If a page is a redirect, it is marked as Redirect instead of Available. The row names examples and intro are composite names taken from the sub-subpages.

user
The syntax is This function takes no arguments and returns the current logged in user name. This is useful when creating user subpages, for example, given the current user is Foo: will link to: The actual link will vary from user to user, creating multiple unique pages by user name, but each user will only see their link. The function can be used anywhere text is allowed, not just links. Most useful with and SemanticForms.