Template:Cite book: Difference between revisions

From WikiMD's Wellness Encyclopedia

No edit summary
No edit summary
Line 1: Line 1:
<includeonly>
<includeonly>
{{#if:{{{title|}}} | <!-- Ensure at least a title is provided -->
{{#if:{{{title|}}} | <!-- Ensure at least a title is provided -->
   {{#if:{{{author|}}} | {{#ifeq:{{{last|}}}|{{{author|}}}| | {{{last}}}, }} }} <!-- Handle author/last -->
   {{#if:{{{author|}}} | {{#ifeq:{{{last|}}}|{{{author|}}}| | {{{last}}}, }} }}  
   {{#if:{{{first|}}}|{{{first}}} }}{{#if:{{{author|}}}|{{{author}}}}}, <!-- Combine author and first -->
   {{#if:{{{first|}}}|{{{first}}} }}{{#if:{{{author|}}}|{{{author}}}}},  
   {{#if:{{{coauthors|}}}|{{{coauthors}}}, }} <!-- Add coauthors -->
   {{#if:{{{coauthors|}}}|{{{coauthors}}}, }}  
   '''{{{title}}}'''{{#if:{{{url|}}}|. [{{{url}}} online version]}}, <!-- Add title with optional URL -->
   '''{{{title}}}'''{{#if:{{{url|}}}|. [{{{url}}} online version]}},  
   {{#if:{{{edition|}}}|{{{edition}}} edition, }} <!-- Add edition -->
   {{#if:{{{edition|}}}|{{{edition}}} edition, }}  
   {{#if:{{{location|}}}|{{{location}}}: }}{{#if:{{{publisher|}}}|{{{publisher}}}, }} <!-- Add location and publisher -->
   {{#if:{{{location|}}}|{{{location}}}: }}{{#if:{{{publisher|}}}|{{{publisher}}}, }}  
   {{#if:{{{year|}}}|{{{year}}}, }} <!-- Add year -->
   {{#if:{{{year|}}}|{{{year}}}, }}  
   {{#if:{{{series|}}}|Series: {{{series}}}, }} <!-- Add series -->
   {{#if:{{{series|}}}|Series: {{{series}}}, }}  
   {{#if:{{{volume|}}}|Volume: {{{volume}}}, }} <!-- Add volume -->
   {{#if:{{{volume|}}}|Volume: {{{volume}}}, }}  
   {{#if:{{{isbn|}}}|ISBN {{{isbn}}}, }} <!-- Add ISBN -->
   {{#if:{{{isbn|}}}|ISBN {{{isbn}}}, }}  
   {{#if:{{{doi|}}}|DOI: {{{doi}}}, }} <!-- Add DOI -->
   {{#if:{{{doi|}}}|DOI: {{{doi}}}, }}  
   {{#if:{{{id|}}}|ID: {{{id}}}, }} <!-- Add additional ID -->
   {{#if:{{{id|}}}|ID: {{{id}}}, }}  
   {{#if:{{{access-date|}}}|Accessed: {{{access-date}}}. }} <!-- Add access date -->
   {{#if:{{{access-date|}}}|Accessed: {{{access-date}}}. }}  
   {{#if:{{{pages|}}}|Pages: {{{pages}}}, }} <!-- Add page or range -->
   {{#if:{{{pages|}}}|Pages: {{{pages}}}, }}  
}}
}}
</includeonly><noinclude>
</includeonly><noinclude>
== Documentation ==
== Documentation ==
This template is used to cite books in MediaWiki articles. The format dynamically includes only provided fields.
This template is used to cite books in MediaWiki articles. The format dynamically includes only provided fields.
=== Parameters ===
=== Parameters ===
* '''title''' – The title of the book (required).
* '''title''' – The title of the book (required).

Revision as of 16:54, 8 February 2025


Documentation

This template is used to cite books in MediaWiki articles. The format dynamically includes only provided fields.

Parameters

  • title – The title of the book (required).
  • author – The author(s) of the book (optional, can use `last` and `first`).
  • coauthors – Coauthors, if applicable.
  • url – URL to the book, if available online.
  • edition – Edition of the book.
  • location – Location of the publisher.
  • publisher – Publisher name.
  • year – Year of publication.
  • series – Series name, if applicable.
  • volume – Volume number, if part of a series.
  • isbn – ISBN of the book.
  • doi – DOI of the book.
  • id – Additional identifier for the book.
  • access-date – Date the book was accessed online.
  • pages – Pages referenced.