Difference between revisions of "Template:Book"

From PKC
Jump to navigation Jump to search
m (1 revision imported)
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
This is the "Book" template.
Please type the following instruction to fill in the reference of a book:


{{#cargo_declare:_table=Books
<nowiki>{{Author=Author(s) separated by ,|Name= Book Name|Publisher=Name of publisher|Year=Year of publication|Edition=Edition|Page=Number of Pages}}</nowiki>
|Authors=List (,) of Page
 
|Genres=List (,) of String
When certain parameters are absent, they will be automatically omitted. The syntax for doing so can be shown as follows:
|Year_of_publication=Date
<nowiki>{{#if:{{{Edition</nowiki><font color=red>|</font><nowiki>}}}|{{{Edition}}} Edition,|}}{{{Publisher}}}</nowiki>
|Number_of_pages=Integer}}
Please note the <nowiki>"pipe"</nowiki> symbol (<font color=red>|</font>) after the parameter name: '''Edition'''<font color=red>|</font>, it is needed to enabled the <code><nowiki>#if</nowiki></code> statement to work.
</noinclude>
</noinclude>
<includeonly>
<includeonly>
{{#cargo_store:_table=Books}}
{{{Author}}},
{|
{{{Name}}},
! Author(s)
{{#if:{{{Edition|}}}|{{{Edition}}} Edition,|}}{{{Publisher}}},
| {{#arraymap:{{{Authors|}}}|,|x|{{#formredlink:form=Author|target=x}} }}
{{{Year}}},
|-
{{#if:{{{Page|}}}|Number of Pages:{{{Page}}}| }}
! Genre(s)
| {{{Genres|}}}
|-
! Year of publication
| {{{Year of publication|}}}
|-
! Number of pages
| {{{Number of pages|}}}
|}
</includeonly>
</includeonly>

Latest revision as of 17:41, 27 June 2021

Please type the following instruction to fill in the reference of a book:

{{Author=Author(s) separated by ,|Name= Book Name|Publisher=Name of publisher|Year=Year of publication|Edition=Edition|Page=Number of Pages}}

When certain parameters are absent, they will be automatically omitted. The syntax for doing so can be shown as follows:

{{#if:{{{Edition|}}}|{{{Edition}}} Edition,|}}{{{Publisher}}}

Please note the "pipe" symbol (|) after the parameter name: Edition|, it is needed to enabled the #if statement to work.