Template:ROOTBOOKNAME

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

This template returns the name of the book associated with the page on which it's used, assuming certain naming conventions. Compare {{ROOTSUBJECTNAME}}.

Usage

Simply place {{ROOTBOOKNAME}} on a page to get the output. When used on category, template, or talk pages, returns the associated book name deduced from naming conventions. Otherwise returns the {{FULLBOOKNAME}}.

Optionally specify a page as a parameter to see the output for a different page than the current one.

{{ROOTBOOKNAME|<full pagename>}}

Examples

page where called result
Wikijunior:Biology Wikijunior:Biology
Chess/Puzzles/Directmates Chess
Wikijunior:Dinosaurs/Apatosaurus Wikijunior:Dinosaurs
Category:Horticulture/Templates/Boxes Horticulture
Wikijunior talk:Bugs/Shield Bug Wikijunior:Bugs
Category:Book:Wikijunior:Solar system/templates Wikijunior:Solar system
Template:Wikijunior:Solar system/coolfacts Wikijunior:Solar system

Internals

This template itself only contains the logic to sort out the namespace and base-name; deducing from those data the associated book name is then delegated to {{ROOTBOOKNAME/core}}.

See also

  • {{BOOKTEMPLATE}} — deduces full root name for templates of book associated with the current page.
  • {{BOOKCATEGORY}} — deduces full root name for categories of book associated with the current page.
  • {{BOOKNAME}} — page name without subpages and without the namespace.
  • {{FULLBOOKNAME}} — page name without subpages and retaining the namespace.
  • {{ROOTSUBJECTNAME}} — deduces full root name of subject associated with the current page.
  • {{SUBJECTCATEGORY}} — deduces full root name of subject-category associated with the current page.