Difference between revisions of "Template:BookCitation"

From BIONICLEsector01
m (Parameters)
(Add nochapternameperiod, noentrynameperiod parameters)
 
Line 1: Line 1:
 
<includeonly>{{#tag:ref
 
<includeonly>{{#tag:ref
|{{#if: {{{chapternumber|}}}|{{#if: {{{chaptername|}}}|"{{{chaptertype|Chapter}}} {{{chapternumber}}}: {{{chaptername}}}."|"{{{chaptertype|Chapter}}} {{{chapternumber}}}."}}|{{#if: {{{chaptername|}}}|"{{{chaptername}}}."|}}}}
+
|{{#if: {{{chapternumber|}}}|{{#if: {{{chaptername|}}}|"{{{chaptertype|Chapter}}} {{{chapternumber}}}: {{{chaptername}}}{{#if: {{{nochapternameperiod|}}}||.}}"|"{{{chaptertype|Chapter}}} {{{chapternumber}}}."}}|{{#if: {{{chaptername|}}}|"{{{chaptername}}}{{#if: {{{nochapternameperiod|}}}||.}}"|}}}}
  
{{#if: {{{entryname|}}}|"{{{entryname}}}." {{#if: {{{entrynumber|}}}|Entry {{{entrynumber}}}.|}}|}}
+
{{#if: {{{entryname|}}}|"{{{entryname}}}{{#if: {{{noentrynameperiod|}}}||.}}" {{#if: {{{entrynumber|}}}|Entry {{{entrynumber}}}.|}}|}}
  
 
{{#switch: {{{1}}}
 
{{#switch: {{{1}}}
Line 97: Line 97:
 
|<code>chaptername</code> '''(optional)'''
 
|<code>chaptername</code> '''(optional)'''
 
|The name of the chapter to cite in the book.
 
|The name of the chapter to cite in the book.
 +
 +
Default: nothing
 +
|-
 +
|<code>nochapternameperiod</code> '''(optional)'''
 +
|Give this parameter any value if <code>chaptername</code> ends in punctuation. This will tell the template not to place a period after <code>chaptername</code>.
  
 
Default: nothing
 
Default: nothing
Line 109: Line 114:
  
 
For instance, if citing the "Tahu" entry in ''[[BIONICLE: Encyclopedia Updated]]'', set <code>entryname</code> to <code>Tahu</code>.
 
For instance, if citing the "Tahu" entry in ''[[BIONICLE: Encyclopedia Updated]]'', set <code>entryname</code> to <code>Tahu</code>.
 +
 +
Default: nothing
 +
|-
 +
|<code>noentrynameperiod</code> '''(optional)'''
 +
|Give this parameter any value if <code>entryname</code> ends in punctuation. This will tell the template not to place a period after <code>entryname</code>.
  
 
Default: nothing
 
Default: nothing

Latest revision as of 19:35, 22 May 2020

Documentation

This template produces citations for books.

Parameters

Parameter Function
(first parameter) The abbreviation representing the piece of media being cited.
(second parameter) (optional) Behaves the same as page. (This is used for backwards compatibility.)
page (optional) The page number to cite in the book.

If citing a range of pages, use startpage and endpage instead.

Default: nothing

startpage (optional) The first page number of the page range to cite in the book.

If citing just one page, use page instead.

Default: nothing

endpage (optional; required if startpage is specified) The last page number of the page range to cite in the book.

If citing just one page, use page instead.

Default: nothing

chapternumber (optional) The number of the chapter to cite in the book.

Default: nothing

chaptername (optional) The name of the chapter to cite in the book.

Default: nothing

nochapternameperiod (optional) Give this parameter any value if chaptername ends in punctuation. This will tell the template not to place a period after chaptername.

Default: nothing

chaptertype (optional) The term used for divisions of the book. For example, some books may be divided into "Parts" instead of "Chapters," so you could set chaptertype to Part and the template would display "Part" wherever "Chapter" would usually go.

Default: Chapter

entryname (optional) The name of the entry to cite in the book.

For instance, if citing the "Tahu" entry in BIONICLE: Encyclopedia Updated, set entryname to Tahu.

Default: nothing

noentrynameperiod (optional) Give this parameter any value if entryname ends in punctuation. This will tell the template not to place a period after entryname.

Default: nothing

entrynumber (optional; only use if entryname is specified) The number of the entry to cite in the book.

For instance, in BIONICLE: Encyclopedia Updated, there are three entries called "Karzahni" (one for the being, one for the plant, and one for the location). If citing the plant entry (the second Karzahni entry), set entryname to Karzahni and entrynumber to 2.

Default: nothing

Examples

  • chapter number[1]
  • page[2]
  • page (using 2nd parameter)[3]
  • start page and end page[4]
  • chapter number and chapter name[5]
  • entry name[6]
  • entry name and entry number[7]
  • "Birth of a Dark Hunter" (a short story in another book)[8]
  • using the same ref multiple times[1]