Template:Book: Difference between revisions

From The Reed and Rite
No edit summary
No edit summary
Line 1: Line 1:
<includeonly>
<includeonly>
<div style="width: 300px; background: #ffffff; border: 1px solid #aaa; padding: 0.5em; margin: 0 auto;">
<div style="max-width: 300px; background: #ffffff; border: 1px solid #aaa; padding: 0.5em;">
   <table style="width: 100%; background: #ffffff; border-spacing: 0; margin: 0;">
   <table style="width: 100%; background: #ffffff; border-spacing: 0; margin: 0;">
    <!-- Title Section -->
     <tr>
     <tr>
       <td colspan="2" style="text-align: center; background-color: #f2f2f2; font-size: 120%; padding: 0.5em; font-weight: bold;">
       <td colspan="2" style="text-align: center; background-color: #f2f2f2; font-size: 120%; padding: 0.5em; font-weight: bold;">{{{title|No title provided}}}</td>
        {{{title|No title provided}}}
      </td>
     </tr>
     </tr>
 
     {{#if: {{{image|}}}|
    <!-- Image Section -->
     {{#if: {{{image|}}} |
     <tr>
     <tr>
       <td colspan="2" style="text-align: center; padding: 0.5em;">
       <td colspan="2" style="text-align: center; padding: 0.5em;">
         [[File:{{{image}}}|200px|alt={{{caption|}}}|{{{caption|}}}]]
         <img src="{{{image}}}" alt="{{{caption|Book cover}}}" style="max-width: 100%; height: auto;"/>
      </td>
        <div style="font-style: italic; font-size: 90%;">{{{caption|No caption provided}}}</div>
    </tr>
    }}
 
    <!-- Caption Section -->
    {{#if: {{{caption|}}} |
    <tr>
      <td colspan="2" style="text-align: center; font-size: 90%; font-style: italic; padding: 0.5em;">
        {{{caption}}}
       </td>
       </td>
     </tr>
     </tr>
     }}
     }}
 
     {{#if: {{{author|}}}|
    <!-- Author Section -->
     {{#if: {{{author|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.5em;">Author</td>
       <td style="font-weight: bold; padding: 0.5em;">Author</td>
Line 34: Line 19:
     </tr>
     </tr>
     }}
     }}
 
     {{#if: {{{audio_read_by|}}}|
    <!-- Audio Read By Section -->
     {{#if: {{{audio_read_by|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.5em;">Audio read by</td>
       <td style="font-weight: bold; padding: 0.5em;">Narrator (Audiobook)</td>
       <td style="padding: 0.5em;">{{{audio_read_by}}}</td>
       <td style="padding: 0.5em;">{{{audio_read_by}}}</td>
     </tr>
     </tr>
     }}
     }}
 
     {{#if: {{{series|}}}|
    <!-- Series Section -->
     {{#if: {{{series|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.5em;">Series</td>
       <td style="font-weight: bold; padding: 0.5em;">Series</td>
Line 50: Line 31:
     </tr>
     </tr>
     }}
     }}
 
     {{#if: {{{publication_date|}}}|
    <!-- Publication Date Section -->
     {{#if: {{{publication_date|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.5em;">Publication date</td>
       <td style="font-weight: bold; padding: 0.5em;">Publication Date</td>
       <td style="padding: 0.5em;">{{{publication_date}}}</td>
       <td style="padding: 0.5em;">{{{publication_date}}}</td>
     </tr>
     </tr>
     }}
     }}
 
     {{#if: {{{publisher|}}}|
    <!-- Publisher Section -->
     {{#if: {{{publisher|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.5em;">Publisher</td>
       <td style="font-weight: bold; padding: 0.5em;">Publisher</td>
Line 66: Line 43:
     </tr>
     </tr>
     }}
     }}
 
     {{#if: {{{media_type|}}}|
    <!-- Media Type Section -->
     {{#if: {{{media_type|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.5em;">Media type</td>
       <td style="font-weight: bold; padding: 0.5em;">Media Type</td>
       <td style="padding: 0.5em;">{{{media_type}}}</td>
       <td style="padding: 0.5em;">{{{media_type}}}</td>
     </tr>
     </tr>
     }}
     }}
 
     {{#if: {{{pages|}}}|
    <!-- Pages Section -->
     {{#if: {{{pages|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.5em;">Pages</td>
       <td style="font-weight: bold; padding: 0.5em;">Pages</td>
Line 82: Line 55:
     </tr>
     </tr>
     }}
     }}
 
     {{#if: {{{genre|}}}|
    <!-- Genre Section -->
     {{#if: {{{genre|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.5em;">Genre</td>
       <td style="font-weight: bold; padding: 0.5em;">Genre</td>
Line 90: Line 61:
     </tr>
     </tr>
     }}
     }}
 
     {{#if: {{{isbn|}}}|
    <!-- ISBN Section -->
     {{#if: {{{isbn|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.5em;">ISBN</td>
       <td style="font-weight: bold; padding: 0.5em;">ISBN</td>
Line 98: Line 67:
     </tr>
     </tr>
     }}
     }}
 
     {{#if: {{{preceded_by|}}}|
    <!-- Preceded By Section -->
     {{#if: {{{preceded_by|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.5em;">Preceded by</td>
       <td style="font-weight: bold; padding: 0.5em;">Preceded By</td>
       <td style="padding: 0.5em;">{{{preceded_by}}}</td>
       <td style="padding: 0.5em;">{{{preceded_by}}}</td>
     </tr>
     </tr>
     }}
     }}
 
     {{#if: {{{proceeded_by|}}}|
    <!-- Proceeded By Section -->
     {{#if: {{{proceeded_by|}}} |
     <tr>
     <tr>
       <td style="font-weight: bold; padding: 0.5em;">Proceeded by</td>
       <td style="font-weight: bold; padding: 0.5em;">Proceeded By</td>
       <td style="padding: 0.5em;">{{{proceeded_by}}}</td>
       <td style="padding: 0.5em;">{{{proceeded_by}}}</td>
     </tr>
     </tr>
Line 117: Line 82:
</div>
</div>
</includeonly>
</includeonly>
<noinclude>
<noinclude>
== Usage ==
== Usage ==

Revision as of 21:47, 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.
  • `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