Template:Cite book: Difference between revisions

From WikiMD's Wellness Encyclopedia

No edit summary
No edit summary
Line 1: Line 1:
<includeonly>
<includeonly>
{{#ifeq:{{{author|}}} | | <!-- No author provided -->
{{#if:{{{title|}}} | <!-- Ensure at least a title is provided -->
   {{#ifeq:{{{last|}}} | | <!-- No author last name provided -->
   {{#if:{{{author|}}} | {{#ifeq:{{{last|}}}|{{{author|}}}| | {{{last}}}, }} }} <!-- Handle author/last -->
    {{#ifeq:{{{first|}}} | | <!-- No author first name provided -->
  {{#if:{{{first|}}}|{{{first}}} }}{{#if:{{{author|}}}|{{{author}}}}}, <!-- Combine author and first -->
      {{#ifeq:{{{title|}}} | | <!-- No title provided -->
  {{#if:{{{coauthors|}}}|{{{coauthors}}}, }} <!-- Add coauthors -->
        {{#ifeq:{{{publisher|}}} | | <!-- No publisher provided -->
  '''{{{title}}}'''{{#if:{{{url|}}}|. [{{{url}}} online version]}}, <!-- Add title with optional URL -->
          {{#ifeq:{{{year|}}} | | <!-- No year provided -->
  {{#if:{{{edition|}}}|{{{edition}}} edition, }} <!-- Add edition -->
            {{#ifeq:{{{isbn|}}} | | <!-- No ISBN provided -->
  {{#if:{{{location|}}}|{{{location}}}: }}{{#if:{{{publisher|}}}|{{{publisher}}}, }} <!-- Add location and publisher -->
  {{#if:{{{year|}}}|{{{year}}}, }} <!-- Add year -->
  {{#if:{{{series|}}}|Series: {{{series}}}, }} <!-- Add series -->
  {{#if:{{{volume|}}}|Volume: {{{volume}}}, }} <!-- Add volume -->
  {{#if:{{{isbn|}}}|ISBN {{{isbn}}}, }} <!-- Add ISBN -->
  {{#if:{{{doi|}}}|DOI: {{{doi}}}, }} <!-- Add DOI -->
  {{#if:{{{id|}}}|ID: {{{id}}}, }} <!-- Add additional ID -->
  {{#if:{{{access-date|}}}|Accessed: {{{access-date}}}. }} <!-- Add access date -->
  {{#if:{{{pages|}}}|Pages: {{{pages}}}, }} <!-- Add page or range -->
}}
</includeonly><noinclude>
== 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.


==Citation==
{{documentation}}
{{{title}}}, {{{author}}}, {{{publisher}}}, {{{year}}}, ISBN:{{{isbn}}}
</noinclude>
<noinclude>{{documentation}}</noinclude></includeonly>

Revision as of 17:10, 11 January 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.