Jump to content

Module:Transclude random subpage/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m {{tlx}}
point to the documentation, now located at the template of the same name
Line 1: Line 1:
{{lua|Module:Transclude random subpage}}
{{lua|Module:Transclude random subpage}}
<!-- EDIT TEMPLATE DOCUMENTATION AFTER THIS LINE -->
<!-- EDIT TEMPLATE DOCUMENTATION AFTER THIS LINE -->
This module implements {{tl|Transclude random subpage}}. Please see the template page for documentation.

This template pulls in the content from one subpage from a set of subpages. Designed primarily for use on portals.

== Layout ==
<pre>
{{Transclude random subpage
|max =
|subpage =
|rootpage =
}}
</pre>

== Usage ==
* '''rootpage''': (Optional) The root of the transcluded page, e.g. ''Portal:Foo''.
* '''subpage''': The subpage of the transcluded page, e.g. ''Selected picture''.
* '''max''': The maximum number of sub-subpages. Must be a positive integer.

=== Formatting subpages ===
* Create a sub-page first. If your portal is {{code|Portal:Foo}}, then a sub-page could be {{code|Portal:Foo/Selected bar}}.
* On the {{code|Portal:Foo/Selected bar}} sub-page, place the template {{tlx|numbered subpages}} on the page and save it.
* Once the list of subject links have been created, use one of the {{code|Selected <subject>}} templates from below to format each of the subject sub-pages.

== Why this template? ==

This template was created to enable {{tlx|Random portal component}} to be replaced with standard portal box notation, including {{tlx|Box-header colour}} and {{tlx|Box-footer}}.

Example:

{{tlx|Random portal component|max{{=}}22|header{{=}}''Selected article''|subpage=Selected article}}

could be replaced by this:

<pre>
{{Box-header colour|Selected article}}
{{Transclude random subpage |max=22|subpage=Selected article}}
{{Box-footer}}
</pre>

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

Revision as of 03:40, 18 November 2019

This module implements {{Transclude random subpage}}. Please see the template page for documentation.