Template:Book: Difference between revisions

From The Reed and Rite
No edit summary
mNo edit summary
Line 1: Line 1:
<includeonly><div style="width: 300px; background: #f8f9fa; border: 1px solid #aaa; padding: 0.5em; float: right; margin: -1.5em 0 1.5em 1em; vertical-align: top; display: inline-block; clear: right; position: relative; top: 1.5em;">
<includeonly>{{Infobox<!--
  <table style="width: 100%; border-spacing: 0; margin: 0; background-color: #f8f9fa;">
-->| name = ''{{{name|}}}''<!--
    <!-- Title -->
-->| image = {{{image|}}}<!--
    <tr>
-->| caption = {{{caption|}}}<!--
      <td colspan="2" style="text-align: center; background-color: #f8f9fa; font-size: 120%; font-weight: bold; padding: 0;">{{{title|No title provided}}}</td>
-->| data_rows =<!--
    </tr>
-->{{#if: {{{author|}}} |<tr class="infobox-data-row"><th>Author</th><td>{{{author}}}</td></tr>}}<!--
    <!-- Image -->
-->{{#if: {{{audio|}}} |<tr class="infobox-data-row"><th>Audio Read By</th><td>{{{audio}}}</td></tr>}}<!--
    {{#if: {{{image|}}} |
-->{{#if: {{{spouse|}}} |<tr class="infobox-data-row"><th>Spouse</th><td>{{{spouse}}}</td></tr>}}<!--
    <tr>
-->{{#if: {{{parents|}}} |<tr class="infobox-data-row"><th>Parents</th><td>{{{parents}}}</td></tr>}}<!--
      <td colspan="2" style="text-align: center; padding: 0; background-color: #f8f9fa;">
-->{{#if: {{{children|}}} |<tr class="infobox-data-row"><th>Children</th><td>{{{children}}}</td></tr>}}<!--
        <div style="display: block; margin: auto; padding: 0.5em 0; background-color: #f8f9fa;">
-->{{#if: {{{relatives|}}} |<tr class="infobox-data-row"><th>Relatives</th><td>{{{relatives}}}</td></tr>}}<!--
          [[File:{{{image}}}|200px|center|alt={{{caption|}}}|{{{caption|}}}]]
-->{{#if: {{{profession|}}} |<tr class="infobox-data-row"><th>Profession</th><td>{{{profession}}}</td></tr>}}<!--
        </div>
-->{{#if: {{{titles|}}} |<tr class="infobox-data-row"><th>Titles</th><td>{{{titles}}}</td></tr>}}<!--
      </td>
-->{{#if: {{{monikers|}}} |<tr class="infobox-data-row"><th>Monikers</th><td>{{{monikers}}}</td></tr>}}<!--
    </tr>
-->{{#if: {{{groups|}}} |<tr class="infobox-data-row"><th>Groups</th><td>{{{groups}}}</td></tr>}}<!--
    }}
-->{{#if: {{{introduced|}}} |<tr class="infobox-data-row"><th>Introduced</th><td>{{{introduced}}}</td></tr>}}<!--
    <!-- Image Caption -->
-->{{#if: {{{first_mentioned|}}} |<tr class="infobox-data-row"><th>First Mentioned</th><td>{{{first_mentioned}}}</td></tr>}}<!--
    {{#if: {{{caption|}}} |
-->{{#if: {{{last_mentioned|}}} |<tr class="infobox-data-row"><th>Last Mentioned</th><td>{{{last_mentioned}}}</td></tr>}}
    <tr>
}}<!--
      <td colspan="2" style="text-align: center; font-size: 80%; font-style: italic; color: #000000; background-color: #f8f9fa; padding: 0.1em 0;">{{{caption}}}</td>
-->{{#ifeq:{{NAMESPACE}}|{{ns:0}}|[[Category:Characters]]}}</includeonly><noinclude>
    </tr>
    }}
    <!-- Data Rows -->
    {{#if: {{{author|}}} |
    <tr>
      <td style="font-weight: bold; padding: 0.1em; vertical-align: top; width: 40%;">Author</td>
      <td style="padding: 0.1em;">{{{author}}}</td>
    </tr>
    }}
    {{#if: {{{audio_read_by|}}} |
    <tr>
      <td style="font-weight: bold; padding: 0.1em; vertical-align: top; width: 40%;">Audio Read by</td>
      <td style="padding: 0.1em;">{{{audio_read_by}}}</td>
    </tr>
    }}
    {{#if: {{{series|}}} |
    <tr>
      <td style="font-weight: bold; padding: 0.1em; vertical-align: top; width: 40%;">Series</td>
      <td style="padding: 0.1em;">{{{series}}}</td>
    </tr>
    }}
    {{#if: {{{period covered|}}} |
    <tr>
      <td style="font-weight: bold; padding: 0.1em; vertical-align: top; width: 40%;">Period Covered</td>
      <td style="padding: 0.1em;">{{{period covered}}}</td>
    </tr>
    }}
    {{#if: {{{publication_date|}}} |
    <tr>
      <td style="font-weight: bold; padding: 0.1em; vertical-align: top; width: 40%;">Publication Date</td>
      <td style="padding: 0.1em;">{{{publication_date}}}</td>
    </tr>
    }}
    {{#if: {{{publication_place|}}} |
    <tr>
      <td style="font-weight: bold; padding: 0.1em; vertical-align: top; width: 40%;">Publication Place</td>
      <td style="padding: 0.1em;">{{{publication_place}}}</td>
    </tr>
    }}
    {{#if: {{{publisher|}}} |
    <tr>
      <td style="font-weight: bold; padding: 0.1em; vertical-align: top; width: 40%;">Publisher</td>
      <td style="padding: 0.1em;">{{{publisher}}}</td>
    </tr>
    }}
    {{#if: {{{media_type|}}} |
    <tr>
      <td style="font-weight: bold; padding: 0.1em; vertical-align: top; width: 40%;">Media Type</td>
      <td style="padding: 0.1em;">{{{media_type}}}</td>
    </tr>
    }}
    {{#if: {{{pages|}}} |
    <tr>
      <td style="font-weight: bold; padding: 0.1em; vertical-align: top; width: 40%;">Pages</td>
      <td style="padding: 0.1em;">{{{pages}}}</td>
    </tr>
    }}
    {{#if: {{{genre|}}} |
    <tr>
      <td style="font-weight: bold; padding: 0.1em; vertical-align: top; width: 40%;">Genre</td>
      <td style="padding: 0.1em;">{{{genre}}}</td>
    </tr>
    }}
    {{#if: {{{isbn|}}} |
    <tr>
      <td style="font-weight: bold; padding: 0.1em; vertical-align: top; width: 40%;">ISBN</td>
      <td style="padding: 0.1em;">{{{isbn}}}</td>
    </tr>
    }}
    {{#if: {{{preceded_by|}}} |
    <tr>
      <td style="font-weight: bold; padding: 0.1em; vertical-align: top; width: 40%;">Preceded by</td>
      <td style="padding: 0.1em;">{{{preceded_by}}}</td>
    </tr>
    }}
    {{#if: {{{followed_by|}}} |
    <tr>
      <td style="font-weight: bold; padding: 0.1em; vertical-align: top; width: 40%;">Followed by</td>
      <td style="padding: 0.1em;">{{{followed_by}}}</td>
    </tr>
    }}
  </table>
</div>
[[Category:Books]]
</includeonly>


<noinclude>
<noinclude>
== Description ==
This template should be used on book pages to add an infobox in the upper right hand corner the article.
== Usage ==
The template has several [[:Template:Character#Parameters|parameters]] that can be used.
: '''Note: Only fields that are provided will appear in the infobox. Not all parameters are required for each character.'''
{| style="width: 100%; text-align: left; margin: auto;" class="wikitable"
|-
! width=50%|You Type
!You Get
|-
| style="text-align: left; background-color: white; vertical-align: top;" |<pre>
{{book
|name=Book Title
|image=FILENAME.EXTENSION
|caption=Caption Here
|author=Author's Name
|audio_read_by=Reader's Name
|series=Series Name
|period covered=Time Period
|publication_date=Date Here
|publication_place=Location here
|publisher=Publisher here
|media_type=Format Here
|pages=Page Numbers
|genre=Genre Here
|isbn=ISBN Here
|preceded_by=Title Here
|followed_by=Title Here
}}
</pre>
| style="background-color: white;" |<br>{{book
| name = Example Book Infobox
| image = Emma - Volume 1.jpg
| caption = Caption Here
| author = Date of Birth
| audio = Date of Death
| spouse = Spouse's Name
| parents = Parent Names
| children = Children Names
| relatives = Relatives Names
| profession = Profession Here
| titles = Titles Here
| monikers = Monikers Here
| groups = Group Affiliations
| introduced = First Appearance
| first_mentioned = First Mentioned
| last_mentioned = Last Mentioned
}}
|}
=== Parameters ===
{| class="wikitable" style="width: 65%;"
! Parameter !! Description
|-
| style="text-align: center;" | <code>name</code> || The character's name.
|-
| style="text-align: center;" | <code>image</code> || Filename of the character's image (e.g., `File:Example.jpg`).
|-
| style="text-align: center;" | <code>caption</code> || Caption for the image.
|-
| style="text-align: center;" | <code>born</code> || The character's date of birth.
|-
| style="text-align: center;" | <code>died</code> || The character's date of death (if applicable).
|-
| style="text-align: center;" | <code>spouse</code> || The character's spouse (if applicable).
|-
| style="text-align: center;" | <code>parents</code> || The character's parents.
|-
| style="text-align: center;" | <code>children</code> || The character's children.
|-
| style="text-align: center;" | <code>relatives</code> || Other relatives of the character.
|-
| style="text-align: center;" | <code>profession</code> || The character's profession.
|-
| style="text-align: center;" | <code>titles</code> || Titles or honorifics the character holds.
|-
| style="text-align: center;" | <code>monikers</code> || Alternate names or nicknames for the character.
|-
| style="text-align: center;" | <code>groups</code> || Groups or affiliations the character belongs to.
|-
| style="text-align: center;" | <code>introduced</code> || Where the character was first introduced (e.g., book, chapter, etc.).
|-
| style="text-align: center;" | <code>first_mentioned</code> || Where the character was first mentioned (e.g., book, chapter, etc.).
|-
| style="text-align: center;" | <code>last_mentioned</code> || Where the character was last mentioned (e.g., book, chapter, etc.).
|}
== Articles using Template ==
:{{for|Special:WhatLinksHere/{{FULLPAGENAME}}|a full listing|here|pre=This list is limited to 100 pages}}
{{Special:WhatLinksHere/{{FULLPAGENAME}}|namespace=0|limit=100}}
[[Category:Infoboxes]]
{{Book
{{Book
| title = Example InfoBox
| title = Example InfoBox

Revision as of 00:45, 19 April 2025


Description

This template should be used on book pages to add an infobox in the upper right hand corner the article.

Usage

The template has several parameters that can be used.

Note: Only fields that are provided will appear in the infobox. Not all parameters are required for each character.
You Type You Get
{{book
|name=Book Title
|image=FILENAME.EXTENSION
|caption=Caption Here
|author=Author's Name
|audio_read_by=Reader's Name
|series=Series Name
|period covered=Time Period
|publication_date=Date Here
|publication_place=Location here
|publisher=Publisher here
|media_type=Format Here
|pages=Page Numbers
|genre=Genre Here
|isbn=ISBN Here
|preceded_by=Title Here
|followed_by=Title Here
}}

Example Book Infobox
Caption Here
Caption Here
Caption Here
AuthorDate of Birth
Audio Read ByDate of Death
SpouseSpouse's Name
ParentsParent Names
ChildrenChildren Names
RelativesRelatives Names
ProfessionProfession Here
TitlesTitles Here
MonikersMonikers Here
GroupsGroup Affiliations
IntroducedFirst Appearance
First MentionedFirst Mentioned
Last MentionedLast Mentioned

Parameters

Parameter Description
name The character's name.
image Filename of the character's image (e.g., `File:Example.jpg`).
caption Caption for the image.
born The character's date of birth.
died The character's date of death (if applicable).
spouse The character's spouse (if applicable).
parents The character's parents.
children The character's children.
relatives Other relatives of the character.
profession The character's profession.
titles Titles or honorifics the character holds.
monikers Alternate names or nicknames for the character.
groups Groups or affiliations the character belongs to.
introduced Where the character was first introduced (e.g., book, chapter, etc.).
first_mentioned Where the character was first mentioned (e.g., book, chapter, etc.).
last_mentioned Where the character was last mentioned (e.g., book, chapter, etc.).

Articles using Template

'
Caption Here
Caption Here
Caption Here
AuthorAuthor's Name

Usage

This is a generic infobox for books. Only fields that are provided will appear in the infobox.

Parameters

  • `title` (required): The book's title.
  • `image`: Filename of the book cover image (e.g., `File:Example.jpg`).
  • `caption`: Caption for the image.
  • `author`: Author of the book.
  • `audio_read_by`: The narrator of the audiobook (if applicable).
  • `series`: Series the book belongs to.
  • 'period covered': Period of time covered in book.
  • `publication_date`: Date the book was published.
  • `publication_place`: Place where the book was published.
  • `publisher`: The book's publisher.
  • `media_type`: The format (e.g., Hardcover, Paperback, eBook, Audiobook).
  • `pages`: Number of pages in the book.
  • `genre`: The book's genre.
  • `isbn`: The ISBN of the book.
  • `preceded_by`: Previous book in the series (if applicable).
  • `followed_by`: Next book in the series (if applicable).