Portal:Mathematics/prev next subpage/doc

This template places "previous" and "next" links (floated to the left and right side of the page) on subpages.

Usage
The template is called with only the (final) subpage names of the pages to be linked to as its two unnamed parameters.
 * Example

If either of these are placed on the page Portal:Mathematics/Selected picture/3, it will display a "< Previous" link back to Portal:Mathematics/Selected picture/2 and a "Next >" link forward to Portal:Mathematics/Selected picture/4. If either page is missing (i.e., would be a redlink), the template suppresses the link, so this template can be used as subpages are being created without worrying about whether the pages exist yet.

If you know a page won't ever exist, you can omit the corresponding parameter value. For example:

can be used on the subpage Portal:Mathematics/Selected picture/1.

This template was created specifically for use by the Mathematics portal, but can be used elsewhere if the full name of the template, "Portal:Mathematics/prev next subpage", is used, as in the first example shown above.

Limitations
Note that this template uses an "expensive parser function" and so can only be used a limited number of times on any given page. For this reason, it should probably be wrapped in  tags so it will only be called on the exact pages it appears on and not when pages are transcluded. To be specific, in the above example, the template call would look like:

This limitation should not be much of an issue, since the purpose of the template is to "chain" a series of subpages together; if multiple subpages are being transcluded onto the same page, there should be no reason to call the template.