Template:Infobox book: Difference between revisions
Appearance
Replace Fandom component markup with native Wikipedia classes; retain source parameters, content, and archived history |
m Remove generated paragraph spacing inside infobox cells; retain Wikipedia CSS |
||
| Line 2: | Line 2: | ||
{{#if:{{{title|}}}|<caption class="infobox-title">{{{title|}}}</caption>|}} | {{#if:{{{title|}}}|<caption class="infobox-title">{{{title|}}}</caption>|}} | ||
{{#if:{{{image|}}}|<tr> | {{#if:{{{image|}}}|<tr> | ||
<td class="infobox-image" colspan="2"> | <td class="infobox-image" colspan="2">{{#ifeq:{{#sub:{{{image|}}}|0|1}}|[|{{{image|}}}|[[{{#ifeq:{{lc:{{#sub:{{{image|}}}|0|5}}}}|file:||{{#ifeq:{{lc:{{#sub:{{{image|}}}|0|6}}}}|image:||File:}}}}{{{image|}}}|frameless|220px]]}}{{#if:{{{imagecaption|}}}|<div class="infobox-caption">{{{imagecaption|}}}</div>|}}</td> | ||
{{#ifeq:{{#sub:{{{image|}}}|0|1}}|[|{{{image|}}}|[[{{#ifeq:{{lc:{{#sub:{{{image|}}}|0|5}}}}|file:||{{#ifeq:{{lc:{{#sub:{{{image|}}}|0|6}}}}|image:||File:}}}}{{{image|}}}|frameless|220px]]}}{{#if:{{{imagecaption|}}}| | |||
<div class="infobox-caption"> | |||
{{{imagecaption|}}} | |||
</div>|}} | |||
</td> | |||
</tr>|}} | </tr>|}} | ||
{{#if:{{{author|}}}|<tr> | {{#if:{{{author|}}}|<tr> | ||
<th class="infobox-label" scope="row"> | <th class="infobox-label" scope="row">Author</th> | ||
Author | <td class="infobox-data">{{{author|}}}</td> | ||
</th> | |||
<td class="infobox-data"> | |||
{{{author|}}} | |||
</td> | |||
</tr>|}} | </tr>|}} | ||
{{#if:{{{illustrator|}}}|<tr> | {{#if:{{{illustrator|}}}|<tr> | ||
<th class="infobox-label" scope="row"> | <th class="infobox-label" scope="row">Illustrator</th> | ||
Illustrator | <td class="infobox-data">{{{illustrator|}}}</td> | ||
</th> | |||
<td class="infobox-data"> | |||
{{{illustrator|}}} | |||
</td> | |||
</tr>|}} | </tr>|}} | ||
{{#if:{{{datePublished|}}}|<tr> | {{#if:{{{datePublished|}}}|<tr> | ||
<th class="infobox-label" scope="row"> | <th class="infobox-label" scope="row">Published on</th> | ||
Published on | <td class="infobox-data">{{{datePublished|}}}</td> | ||
</th> | |||
<td class="infobox-data"> | |||
{{{datePublished|}}} | |||
</td> | |||
</tr>|}} | </tr>|}} | ||
{{#if:{{{publisher|}}}|<tr> | {{#if:{{{publisher|}}}|<tr> | ||
<th class="infobox-label" scope="row"> | <th class="infobox-label" scope="row">Publisher</th> | ||
Publisher | <td class="infobox-data">{{{publisher|}}}</td> | ||
</th> | |||
<td class="infobox-data"> | |||
{{{publisher|}}} | |||
</td> | |||
</tr>|}} | </tr>|}} | ||
{{#if:{{{previous|}}}{{{next|}}}|<tr> | {{#if:{{{previous|}}}{{{next|}}}|<tr> | ||
<th class="infobox-header" colspan="2"> | <th class="infobox-header" colspan="2">Publication order</th> | ||
Publication order | |||
</th> | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td class="infobox-full-data" colspan="2"> | <td class="infobox-full-data" colspan="2"><table class="infobox-subbox"> | ||
<table class="infobox-subbox"> | |||
<tr> | <tr> | ||
{{#if:{{{previous|}}}|<th class="infobox-label" scope="col"> | {{#if:{{{previous|}}}|<th class="infobox-label" scope="col">Previous</th>|}} | ||
Previous | {{#if:{{{next|}}}|<th class="infobox-label" scope="col">Next</th>|}} | ||
</th>|}} | |||
{{#if:{{{next|}}}|<th class="infobox-label" scope="col"> | |||
Next | |||
</th>|}} | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
{{#if:{{{previous|}}}|<td class="infobox-data"> | {{#if:{{{previous|}}}|<td class="infobox-data">{{{previous|}}}</td>|}} | ||
{{{previous|}}} | {{#if:{{{next|}}}|<td class="infobox-data">{{{next|}}}</td>|}} | ||
</td>|}} | |||
{{#if:{{{next|}}}|<td class="infobox-data"> | |||
{{{next|}}} | |||
</td>|}} | |||
</tr> | </tr> | ||
</table> | </table></td> | ||
</td> | |||
</tr>|}} | </tr>|}} | ||
</table>|}}<includeonly>[[Category:Books]]</includeonly><noinclude> | </table>|}}<includeonly>[[Category:Books]]</includeonly><noinclude> | ||
Latest revision as of 18:52, 11 November 2026
Native MediaWiki infobox using locally mirrored Wikipedia styles. Image fields accept a bare filename, a File:-prefixed name, or complete [[File:…]] markup. Fields, defaults, and categories retain the imported template API.
Template documentation
Note: portions of the template sample may not be visible without values provided.
View or edit this documentation. (About template documentation)
Editors can experiment in this template's sandbox and test case pages.
Description
To use this template, copy the following code and fill in the appropriate fields.
Syntax
{{infobox book
| title =
| image = [e.g. "Example.jpg"]
| author =
| illustrator =
| datePublished =
| publisher =
| previous =
| next =
}}
Sample output
![]() |
|||||
| Author | Alice | ||||
|---|---|---|---|---|---|
| Illustrator | Bob | ||||
| Published on | April 1928 | ||||
| Publisher | Arthur's | ||||
| Publication order | |||||
|
|||||
{{infobox book
| title = The Adventures of Flower
| image = Example.jpg
| author = Alice
| illustrator = Bob
| datePublished = April 1928
| publisher = Arthur's
| previous = Book One
| next = Book Three
}}
