Template:Book: Difference between revisions

From The Reed and Rite
No edit summary
No edit summary
Line 1: Line 1:
<includeonly>
<includeonly>
<div style="max-width: 300px; background: #ffffff; border: 1px solid #aaa; padding: 0.5em; float: right; margin-left: 1em;">
<div style="width: 300px; background: #ffffff; border: 1px solid #aaa; padding: 0.5em; float: right; margin: 0 0 1em 1em;">
   <table style="width: 100%; background: #ffffff; border-spacing: 0; margin: 0;">
   <table style="width: 100%; background: #ffffff; border-spacing: 0; margin: 0;">
    <!-- Title -->
     <tr>
     <tr>
       <td colspan="2" style="text-align: center; background-color: #f2f2f2; font-size: 120%; padding: 0.2em; font-weight: bold;">{{{title|No title provided}}}</td>
       <td colspan="2" style="text-align: center; background-color: #f2f2f2; font-size: 120%; padding: 0.5em; font-weight: bold;">{{{title|No title provided}}}</td>
     </tr>
     </tr>
    <!-- Image -->
     {{#if: {{{image|}}} |
     {{#if: {{{image|}}} |
     <tr>
     <tr>
       <td colspan="2" style="text-align: center;">
       <td colspan="2" style="text-align: center; padding: 0.5em;">
         [[File:{{{image}}}|200px|alt={{{caption|No caption provided}}}|{{{caption|No caption provided}}}]]
         [[File:{{{image}}}|200px|alt={{{caption|}}}|{{{caption|}}}]]
       </td>
       </td>
     </tr>
     </tr>
     }}
     }}
    <!-- Image Caption -->
     {{#if: {{{caption|}}} |
     {{#if: {{{caption|}}} |
     <tr>
     <tr>
       <td colspan="2" style="text-align: center; font-size: 90%; font-style: italic; padding: 0.2em;">
       <td colspan="2" style="text-align: center; font-size: 90%; font-style: italic; padding: 0.5em;">{{{caption}}}</td>
        {{{caption}}}
      </td>
     </tr>
     </tr>
     }}
     }}
     {{#if: {{{author|}}}|
    <!-- Data Rows -->
     {{#if: {{{author|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.2em;">Author</td>
       <td style="font-weight: bold; padding: 0.2em;">Author</td>
Line 25: Line 27:
     </tr>
     </tr>
     }}
     }}
     {{#if: {{{audio_read_by|}}}|
     {{#if: {{{audio_read_by|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.2em;">Audio Read By</td>
       <td style="font-weight: bold; padding: 0.2em;">Audio read by</td>
       <td style="padding: 0.2em;">{{{audio_read_by}}}</td>
       <td style="padding: 0.2em;">{{{audio_read_by}}}</td>
     </tr>
     </tr>
     }}
     }}
     {{#if: {{{series|}}}|
     {{#if: {{{series|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.2em;">Series</td>
       <td style="font-weight: bold; padding: 0.2em;">Series</td>
Line 37: Line 39:
     </tr>
     </tr>
     }}
     }}
     {{#if: {{{publication_date|}}}|
     {{#if: {{{publication_date|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.2em;">Publication Date</td>
       <td style="font-weight: bold; padding: 0.2em;">Publication date</td>
       <td style="padding: 0.2em;">{{{publication_date}}}</td>
       <td style="padding: 0.2em;">{{{publication_date}}}</td>
     </tr>
     </tr>
     }}
     }}
     {{#if: {{{publication_place|}}}|
     {{#if: {{{publication_place|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.2em;">Publication Place</td>
       <td style="font-weight: bold; padding: 0.2em;">Publication place</td>
       <td style="padding: 0.2em;">{{{publication_place}}}</td>
       <td style="padding: 0.2em;">{{{publication_place}}}</td>
     </tr>
     </tr>
     }}
     }}
     {{#if: {{{publisher|}}}|
     {{#if: {{{publisher|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.2em;">Publisher</td>
       <td style="font-weight: bold; padding: 0.2em;">Publisher</td>
Line 55: Line 57:
     </tr>
     </tr>
     }}
     }}
     {{#if: {{{media_type|}}}|
     {{#if: {{{media_type|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.2em;">Media Type</td>
       <td style="font-weight: bold; padding: 0.2em;">Media type</td>
       <td style="padding: 0.2em;">{{{media_type}}}</td>
       <td style="padding: 0.2em;">{{{media_type}}}</td>
     </tr>
     </tr>
     }}
     }}
     {{#if: {{{pages|}}}|
     {{#if: {{{pages|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.2em;">Pages</td>
       <td style="font-weight: bold; padding: 0.2em;">Pages</td>
Line 67: Line 69:
     </tr>
     </tr>
     }}
     }}
     {{#if: {{{genre|}}}|
     {{#if: {{{genre|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.2em;">Genre</td>
       <td style="font-weight: bold; padding: 0.2em;">Genre</td>
Line 73: Line 75:
     </tr>
     </tr>
     }}
     }}
     {{#if: {{{isbn|}}}|
     {{#if: {{{isbn|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.2em;">ISBN</td>
       <td style="font-weight: bold; padding: 0.2em;">ISBN</td>
Line 79: Line 81:
     </tr>
     </tr>
     }}
     }}
     {{#if: {{{preceded_by|}}}|
     {{#if: {{{preceded_by|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.2em;">Preceded By</td>
       <td style="font-weight: bold; padding: 0.2em;">Preceded by</td>
       <td style="padding: 0.2em;">{{{preceded_by}}}</td>
       <td style="padding: 0.2em;">{{{preceded_by}}}</td>
     </tr>
     </tr>
     }}
     }}
     {{#if: {{{proceeded_by|}}}|
     {{#if: {{{proceeded_by|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.2em;">Proceeded By</td>
       <td style="font-weight: bold; padding: 0.2em;">Proceeded by</td>
       <td style="padding: 0.2em;">{{{proceeded_by}}}</td>
       <td style="padding: 0.2em;">{{{proceeded_by}}}</td>
     </tr>
     </tr>
Line 94: Line 96:
</div>
</div>
</includeonly>
</includeonly>
<noinclude>
<noinclude>
== Usage ==
== Usage ==

Revision as of 23:03, 20 November 2024


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.
  • `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).
  • `proceeded_by`: Next book in the series (if applicable).

Example Usage

```wiki Template:InfoboxBook