Template:Root subject

From Wikibooks, open books for an open world
Jump to: navigation, search

< Books by subject

Wikibooks-logo.svg
Root subject
{{{description}}}
Chart organisation.svg
Subsections
Star*.svg
Featured Books
Template documentation[edit] [history] [purge]

This template is used on top-level subject pages to list books within that subject's respective category. Use {{subject page}} for regular subjects.

Usage

Parameters, of which only the first is required:

  • description: specifies the description of the subject area the page will cover
  • featuredbooks: alternative to an automatically generated list, specifies a list of featured books in the sub-subjects of this top-level subject as an HTML unordered list (<ul><li>[[Book]]</li><li>[[Book2]]</li></ul>)
  • namespace: optional, specifies which namespace should be searched through for books; defaults to the main namespace
  • theme: optional, specifies the {{Robox}} theme for the description box; defaults to 15
  • theme2: optional, specifies the {{Robox}} theme for the book 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
{{root subject
 |description=
}}
{{root subject
 |namespace=
 |theme=
 |theme2=
 |icon=
 |iconwidth=
 |featuredbooks=
 |description=
}}

Internals

This template itself contains only interface logic: default values for parameters, and code to allow certain parameters to be extracted for use with allbooks categories. Internal code to implement the page layout is in template {{Root subject/core}}.

Parameter extraction uses the same arrangement as with {{subject page}}. The string provided for extraction is fixed (there being no actual parent parameters by which to vary it) as /Books by subject/ — thus presenting each root subject as a child of single parent Subject:Books by subject. (Subject:Books by subject also uses this same "parameter extraction" scheme, presenting itself as having no parents, i.e., //.)