Difference between revisions of "Template:InfoBoxTest"

From Book Trigger Warnings
(Add documentation)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
<includeonly>
 
<div class="infobox">
 
<div class="infobox">
<div class="infobox-title">{{{title|{{PAGENAME}}}}}</div>
+
<div class="infobox-title">''{{{title|{{PAGENAME}}}}}''</div>
  
 +
{{#if: {{{image|}}}|
 
<div class="infobox-image">[[File:{{{image}}}|200px]]</div>
 
<div class="infobox-image">[[File:{{{image}}}|200px]]</div>
 +
|<div class="infobox-image">[[File:default.png|200px]]</div>
 +
}}
  
 
<table>
 
<table>
 
<tr>
 
<tr>
 
     <th>Author</th>
 
     <th>Author</th>
     <td>{{{author}}}</td>
+
     <td>{{{author|Unknown}}}</td>
 
</tr>
 
</tr>
 +
{{#if: {{{published|}}}|
 
<tr>
 
<tr>
 
     <th>Published</th>
 
     <th>Published</th>
 
     <td>{{{published}}}</td>
 
     <td>{{{published}}}</td>
 
</tr>
 
</tr>
 +
}}
 +
{{#if: {{{genres|}}}|
 
<tr>
 
<tr>
 
     <th>Genre(s)</th>
 
     <th>Genre(s)</th>
 
     <td>{{{genres}}}</td>
 
     <td>{{{genres}}}</td>
 
</tr>
 
</tr>
 +
}}
 
{{#if: {{{agegroup|}}}|
 
{{#if: {{{agegroup|}}}|
 
<tr>
 
<tr>
Line 25: Line 33:
 
</table>
 
</table>
 
</div>
 
</div>
 +
</includeonly>
 +
<noinclude>
 +
This is the main template used for displaying the general book information on the top right of an article.
 +
 +
Here is a description of the parameters available and the default values they take on if nothing is specified (if applicable):
 +
<pre>
 +
{{InfoBox
 +
| title = The title of the book. Default: the name of the article
 +
| author = The author of the book. Default: Unknown
 +
| image = The name of the cover image of the book. Default: default.png
 +
| published = The year of publication.
 +
| genres = The genre(s) of this novel. Such as Horror, Science Fiction, Contemporary Fiction, Poetry, etc. If multiple genres are given, they should be separated with a <br> tag.
 +
| agegroup = The age group of this novel. This should be Adult, New Adult, Young Adult, Middle Grade, Children's Fiction.
 +
}}
 +
</pre>
 +
When no default is mentioned, what happens is that the template does not display an entry for that data.
 +
 +
==Examples==
 +
 +
Here are two sample uses of the template. If you would like to see more, most of our articles use this template.
 +
 +
{{InfoBoxTest
 +
| title = A Song of Foo and Bar
 +
| author = F. L. Theorem
 +
| image = default.png
 +
| published = 1999
 +
| genres = Horror<br>Science Fiction
 +
| agegroup = Young Adult
 +
}}
 +
<pre style="overflow:auto;">
 +
{{InfoBoxTest
 +
| title = A Song of Foo and Bar
 +
| author = F. L. Theorem
 +
| image = default.png
 +
| published = 1999
 +
| genres = Horror<br>Science Fiction
 +
| agegroup = Young Adult
 +
}}
 +
</pre>
 +
<div style="clear:both;"></div>
 +
 +
{{InfoBoxTest
 +
| title = The Red Crimson
 +
| author = Jen Black
 +
| genres = Thriller
 +
}}
 +
<pre style="overflow:auto;">
 +
{{InfoBoxTest
 +
| title = The Red Crimson
 +
| author = Jen Black
 +
| genres = Thriller
 +
}}
 +
</pre>
 +
<div style="clear:both;"></div>
 +
</noinclude>

Latest revision as of 19:04, 25 June 2020


This is the main template used for displaying the general book information on the top right of an article.

Here is a description of the parameters available and the default values they take on if nothing is specified (if applicable):

{{InfoBox
| title = The title of the book. Default: the name of the article
| author = The author of the book. Default: Unknown
| image = The name of the cover image of the book. Default: default.png
| published = The year of publication.
| genres = The genre(s) of this novel. Such as Horror, Science Fiction, Contemporary Fiction, Poetry, etc. If multiple genres are given, they should be separated with a <br> tag.
| agegroup = The age group of this novel. This should be Adult, New Adult, Young Adult, Middle Grade, Children's Fiction.
}}

When no default is mentioned, what happens is that the template does not display an entry for that data.

Examples

Here are two sample uses of the template. If you would like to see more, most of our articles use this template.


A Song of Foo and Bar
Default.png
Author F. L. Theorem
Published 1999
Genre(s) Horror
Science Fiction
Age group Young Adult


{{InfoBoxTest
| title = A Song of Foo and Bar
| author = F. L. Theorem
| image = default.png
| published = 1999
| genres = Horror<br>Science Fiction
| agegroup = Young Adult
}}


The Red Crimson
Default.png
Author Jen Black
Genre(s) Thriller


{{InfoBoxTest
| title = The Red Crimson
| author = Jen Black
| genres = Thriller
}}