Jump to content

Module:Transclude random subpage/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
write documentation
Line 41: Line 41:
</syntaxhighlight>
</syntaxhighlight>


This also allows a box to be modified (edited) independently of its contents, and in a way that matches the other boxes on the page.
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 09:03, 7 November 2018

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

Layout

{{Transclude random subpage
 |max      =
 |subpage  = 
 |rootpage =
}}

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 Portal:Foo, then a sub-page could be Portal:Foo/Selected bar.
  • On the Portal:Foo/Selected bar sub-page, place the template {{numbered subpages}} on the page and save it.
  • Once the list of subject links have been created, use one of the Selected <subject> templates from below to format each of the subject sub-pages.
  • This template calls /box-header (if headertemplate is not specified) and {{box-footer}} for its color styles and closing. Either headertemplate must be used, or the /box-header subpage must exist for everything to work correctly.

Why this template?

This template was created to be used with {{Box-header colour}}, to replace instances of {{Random portal component}}

Example:

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

could be replaced by this:

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

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