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 --> | ||
{{#ifeq:{{{last|}}} | | <!-- | {{#if:{{{author|}}} | {{#ifeq:{{{last|}}}|{{{author|}}}| | {{{last}}}, }} }} <!-- Handle author/last --> | ||
{{#if:{{{first|}}}|{{{first}}} }}{{#if:{{{author|}}}|{{{author}}}}}, <!-- Combine author and first --> | |||
{{#if:{{{coauthors|}}}|{{{coauthors}}}, }} <!-- Add coauthors --> | |||
'''{{{title}}}'''{{#if:{{{url|}}}|. [{{{url}}} online version]}}, <!-- Add title with optional URL --> | |||
{{#if:{{{edition|}}}|{{{edition}}} edition, }} <!-- Add edition --> | |||
{{#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. | |||
{{documentation}} | |||
{{ | </noinclude> | ||
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.