Template:Department:Page

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Template documentation[edit] [history] [purge]
create use count

Usage

Use this template on a department page in the Wikibooks Stacks; everything on the department page other than the template call should be noincluded.

The template primarily provides a detailed display of information about the department, including its description, its children (immediate subshelves), and featured books on any of its shelves. It only performs that primary function if called from a PAGENAME with the prefix and not overridden by unnamed parameter.

The corresponding template for shelves is {{Shelf:Page}}.

Parameters

  • description: specifies the description of the subject matter the department covers.
  • namespace: optional, specifies which namespace should be searched through for books; defaults to the main namespace.
  • reserved: optional, specifies the description of a reserved shelf for the department, or blank to indicate there should be an inclusive shelf for the department instead of a reserved shelf. Default is general references.
  • 1: needs to be passed through from the department page to this template, otherwise it would not be possible for a transcluding page to override the display function.

Cosmetic parameters, less often used:

  • theme: optional, specifies the {{Robox}} theme for the description box; defaults to 15.
  • theme2: optional, specifies the {{Robox}} theme for the books box; defaults to 3.
  • icon: optional, specifies the logo displayed in the description box without the File: included; defaults to the Wikibooks logo.
  • iconwidth: optional, specifies the width of the logo displayed in the description box with px included; defaults to 45px.

Copy-paste

Commonly-used Full
{{Department:Page
 |description=
 |1={{{1|}}}
}}
{{Department:Page
 |description=
 |namespace=
 |reserved=
 |1={{{1|}}}
 |theme=
 |theme2=
 |icon=
 |iconwidth=
}}

Internals

This template itself determines which sort of information request is being made, and either provides information directly, or delegates the display function to {{Department:Page/display}}. Delegation is done using Module:TScope#override, so that the subtemplate can tell which parameters were not provided, in order to supply default values for them.

When the transcluding page is in mainspace, has PAGENAME prefix Department:, and is not overridden by a non-blank first unnamed parameter, this template delegates to produce a full display. If the unnamed parameter has value reserved, this template returns the value of its parameter reserved. Otherwise, this template returns its own name, Department:Page.