Template:Root subject/doc
This is a documentation subpage for Template:Root subject It may contain usage information, categories and other content that is not part of the original template page. |
This template is used on top-level subject pages to list books within that subject's respective category. Used on a subject page, it also handles queries to the subject page from other pages. Use {{subject page}} for regular subjects.
Usage
[edit source]Parameters, of which only the first is required:
description
: specifies the description of the subject area the page will coverfeaturedbooks
: 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 namespacetheme
: optional, specifies the {{Robox}} theme for the description box; defaults to 15theme2
: optional, specifies the {{Robox}} theme for the book box; defaults to 3icon
: optional, specifies the logo displayed in the description box without theFile:
included; defaults to the Wikibooks logoiconwidth
: optional, specifies the width of the logo displayed in the description box withpx
included; defaults to 45px1
: needs to be passed through from the calling subject page to this template, otherwise the subject category can't extra a subject description or full header2
: optional, specifies how much information is allowed to be provided to the subject category; possible values are blank (no description or header),description
(only provide a description) orheader
(provide a full header); note however thatheader
does the same thing as omitting parameter2
, while blank does the same thing as omitting parameter1
Copy-paste
[edit source]Commonly-used | Full |
---|---|
{{root subject |description= |1={{{1}}} }} |
{{root subject |namespace= |theme= |theme2= |icon= |iconwidth= |featuredbooks= |description= |1={{{1}}} |2= }} |
Internals
[edit source]Internals
[edit source]This template itself only determines which sort of information request is being made, and either provides the information (if it isn't asking for a full subject display); or delegates the request to {{root subject/core}}, which is responsible for generating a full 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 Subject:
or Template:
space, this template always delegates to produce a full display. In all other namespaces, ordinarily the template returns a string describing the parentage of the subject. The general form of the parentage string is described at {{subject page}}; here the string provided 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 parentage-string scheme, presenting itself as having no parents, i.e., //.)
Parameters 1
and 2
function as described at {{subject page}}.