Template:Transclude random subpage/doc

This template pulls in the content of one sub-subpage randomly chosen from a set of numerically-named sub-subpages. Designed primarily for use on portals.

Usage

 * rootpage: (Optional) The root of the transcluded page, that is, the page the transclusion takes place on. e.g. Portal:Foo.
 * subpage: The subpage of the root that is the parent of the transcluded sub-subpages, e.g. Selected article.
 * max: The maximum number of sub-subpages. Must be a positive integer.

Setting up the subpage, and the sub-subpages
To see an example, see Portal:Psychiatry -- it uses this template and a corresponding subpage scheme.
 * Create the subpage first. If your portal is Portal:Foo, then the subpage could be Portal:Foo/Selected bar.
 * On the subpage (in this case, Portal:Foo/Selected bar), place the template on that page and save it.
 * Create subpages for that subpage, naming them /1, /2, /3, etc., and on each one, copy/paste the content you wish to transclude. In this example, that would be a description of a different bar (tavern) lifted from an article about a bar, for each numerical page.

Why this template?
This template was created to enable to be replaced with standard portal box notation, including  and.

Example:

could be replaced by this:

This also allows a box to be modified (edited) independently of its contents, and to match the other boxes on the page.