Difference between revisions of "Template:Book list"

From blackwiki
Jump to navigation Jump to search
imported>PeterSymonds
m (Protected Template:Book list: Highly visible template ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
imported>MSGJ
(adding book number column and option to change alignment, plus other tweaks as discussed on talk page)
Line 1: Line 1:
<tr style="text-align: center; background:#F2F2F2; border-top:3px solid {{#switch: {{lc:{{{line_color|Љ}}}}} | novel=#93B8C4 | shortstory=#AFDCEC | poetry=#FFF380 | play=#CCFB5D | screenplay=#A0C544 | nonfiction=#636363 | comic=#CC6666 | unpublished=#DBDBDB | Љ=#CCCCFF | {{{line_color}}} }}">
+
<noinclude><table>
<td style="text-align: center;">{{#if:{{{title|}}}|'''{{{title}}}'''}}{{#if:{{{alt_title|}}}|<br />{{{alt_title}}}}}</td>{{
+
</noinclude><tr style="text-align: center; background:#{{{background|F2F2F2}}};">
#ifeq:{{{author|Љ}}}|Љ| |<td>{{{author}}}</td>}}{{
+
{{#if:{{{book_number|}}}|<td>{{{book_number}}}</td>}}<td style="text-align: left;">{{#if:{{{title|}}}|'''{{{title}}}'''}}{{#if:{{{alt_title|}}}|<br />{{{alt_title}}}}}</td>{{
#ifeq:{{{publisher|Љ}}}|Љ| |<td>{{{publisher}}}</td>}}{{
+
#if:{{{author|}}}|<td>{{{author}}}</td>}}{{
#ifeq:{{{publish_date|Љ}}}|Љ| |<td>{{{publish_date}}}}}{{#if:{{{alt_publish_date|}}}|<br />{{{alt_publish_date}}}}}</td>{{
+
#if:{{{publisher|}}}|<td>{{{publisher}}}</td>}}{{
#ifeq:{{{subject|Љ}}}|Љ| |<td>{{{subject}}}</td>}}{{
+
#if:{{{publish_date|}}}|<td>{{{publish_date}}}}}{{#if:{{{alt_publish_date|}}}|<br />{{{alt_publish_date}}}}}</td>{{
#ifeq:{{{genre|Љ}}}|Љ| |<td>{{{genre}}}</td>}}{{
+
#if:{{{subject|}}}|<td>{{{subject}}}</td>}}{{
#ifeq:{{{aux1|Љ}}}|Љ| |<td>{{{aux1}}}</td>}}{{
+
#if:{{{genre|}}}|<td>{{{genre}}}</td>}}{{
#ifeq:{{{aux2|Љ}}}|Љ| |<td>{{{aux2}}}</td>}}{{
+
#if:{{{aux1|}}}|<td>{{{aux1}}}</td>}}{{
#ifeq:{{{aux3|Љ}}}|Љ| |<td>{{{aux3}}}</td>}}{{
+
#if:{{{aux2|}}}|<td>{{{aux2}}}</td>}}{{
#ifeq:{{{isbn|Љ}}}|Љ| |<td>ISBN {{{isbn}}}</td>}}{{
+
#if:{{{aux3|}}}|<td>{{{aux3}}}</td>}}{{
#ifeq:{{{short_summary|Љ}}}|Љ| |<tr><td colspan="{{#expr:1+{{#ifeq:{{{author|Љ}}}|0|1}}+{{#ifeq:{{{publisher|Љ}}}|0|1}}+{{#ifeq:{{{publish_date|Љ}}}|0|1}}+{{#ifeq:{{{subject|Љ}}}|0|1}}+{{#ifeq:{{{genre|Љ}}}|0|1}}+{{#ifeq:{{{aux1|Љ}}}|0|1}}+{{#ifeq:{{{aux2|Љ}}}|0|1}}+{{#ifeq:{{{aux3|Љ}}}|0|1}}+{{#ifeq:{{{isbn|Љ}}}|0|1}}}}">{{{short_summary|}}}&nbsp;</td></tr>
+
#if:{{{isbn|}}}|<td>ISBN {{{isbn}}}</td>}}{{
}}
+
#if:{{{short_summary|}}}
<noinclude>
+
|<tr><td colspan="{{#expr:{{#if:{{{book_number|}}}|0|1}}+1+{{#if:{{{author|}}}|0|1}}+{{#if:{{{publisher|}}}|0|1}}+{{#if:{{{publish_date|}}}|0|1}}+{{#if:{{{subject|}}}|0|1}}+{{#if:{{{genre|}}}|0|1}}+{{#if:{{{aux1|}}}|0|1}}+{{#if:{{{aux2|}}}|0|1}}+{{#if:{{{aux3|}}}|0|1}}+{{#if:{{{isbn|}}}|0|1}}}}" style="border-bottom:3px solid {{#switch: {{lc:{{{line_color|}}}}}
{{template doc}}
+
  | novel=#93B8C4
 +
  | shortstory=#AFDCEC
 +
  | poetry=#FFF380
 +
  | play=#CCFB5D
 +
  | screenplay=#A0C544
 +
  | nonfiction=#636363
 +
  | comic=#CC6666
 +
  | unpublished=#DBDBDB
 +
  | {{{line_color|#CCCCFF}}}
 +
}}">{{{short_summary|}}}&nbsp;</td></tr>
 +
}}<noinclude>
 +
</table>
 +
{{documentation}}
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 
</noinclude>
 
</noinclude>

Revision as of 18:26, 6 August 2010

Template documentation[view] [edit] [history] [purge]

Usage

Parameters Description
Book list Book table
1 Unnamed parameter. Main page for sublists that are transcluded elsewhere.
Transclusion to declared page will hide summaries.
background HEX code for row background HEX code for table header background
book_number Book number (e.g. series numbering sequence) "No."
title Book title "Title"
alt_title Alternate title (e.g. original foreign language title)
author Author(s) "Author"
publisher Publisher of main publication "Publisher"
publish_date Date first published "Date"
alt_publish_date Alternate date published (e.g. translation release)
subject Subject(s) for non-fiction "Subject"
genre Genre(s) for fiction "Genre"
aux[1-3] Optional parameters, meaning is specified by the table header
(e.g. language, translator, country, series, illustrator, pages, oclc)
Text describing optional cells
isbn ISBN "ISBN"
isbn_note Any notes about the given ISBN (e.g. hardcover)
short_summary If possible, keep summaries under three or four sentences
line_color The separator line between entries, predefined values exist for:
novel, shortstory, poetry, play, screenplay, nonfiction, unpublished
books Usages of {{Book list}}

Example

{{Book table |background=#A2BBAC |book_number= |title= |author= |publisher= |publish_date= |genre= |aux1=Length |isbn= |books=
{{Book list
 | book_number    = 1
 | title          = [[Anne of Green Gables]]
 | author         = [[Lucy Maud Montgomery]]
 | publisher      = [[L. C. Page & Co.]]
 | publish_date   = April 1908
 | genre          = [[Children's literature|Children's novel]]
 | aux1           = 429 pp ''(first edition)''
 | isbn           = 9780393926958
 | line_color     = novel
 | short_summary  = Miss Marilla Cuthbert and Mr. Matthew Cuthbert, middle-aged siblings who live together at Green Gables, a farm in Avonlea, on Prince Edward Island, decide to adopt an orphan boy from the asylum as a helper on their farm. Through a series of mishaps, what ends up under their roof is a precocious girl of eleven named Anne Shirley.
}}
}}
No.TitleAuthorPublisherDateGenreLengthISBN
1Anne of Green GablesLucy Maud MontgomeryL. C. Page & Co.April 1908Children's novel429 pp (first edition)ISBN 9780393926958
Miss Marilla Cuthbert and Mr. Matthew Cuthbert, middle-aged siblings who live together at Green Gables, a farm in Avonlea, on Prince Edward Island, decide to adopt an orphan boy from the asylum as a helper on their farm. Through a series of mishaps, what ends up under their roof is a precocious girl of eleven named Anne Shirley. 

See also