Template:Book ref: Difference between revisions

m Removed background color to allow dynamic color shift in dark mode.
 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#tag:ref|
<includeonly>{{#if:{{{link|}}}<!--
{{#if:{{{1|}}} | <!-- Check if book title is provided -->
 
  {{#switch:{{lc:{{{1}}}}}
PASS "|link=y" TO REMOVE REFERENCE TAG AND INSERT A PLAINLINK
    | beast = [[Summary:The Beast of Ten#Chapter {{{2}}}|''The Beast of Ten'', Chapter {{{2}}}]]
-->| {{#if:{{{1|}}}<!--
    | tbot = [[Summary:The Beast of Ten#Chapter {{{2}}}|''The Beast of Ten'', Chapter {{{2}}}]]
  -->| {{#switch:{{lc:{{{2}}}}}<!--
    | bot = [[Summary:The Beast of Ten#Chapter {{{2}}}|''The Beast of Ten'', Chapter {{{2}}}]]
  -->| prologue = [[Summary:{{B|{{{1}}}}}#Prologue|''{{B|{{{1}}}}}'', Prologue]]<!--
    | b10 = [[Summary:The Beast of Ten#Chapter {{{2}}}|''The Beast of Ten'', Chapter {{{2}}}]]
  -->| epilogue = [[Summary:{{B|{{{1}}}}}#Epilogue|''{{B|{{{1}}}}}'', Epilogue]]<!--
    | tqg = [[Summary:The Queen's Gambit#Chapter {{{2}}}|''The Queen's Gambit'', Chapter {{{2}}}]]
  -->| {{#ifexpr: {{{2}}} > 0 and {{{2}}} <= 75<!--
     | qg = [[Summary:The Queen's Gambit#Chapter {{{2}}}|''The Queen's Gambit'', Chapter {{{2}}}]]
     -->| [[Summary:{{B|{{{1}}}}}#Chapter_{{{2}}}|''{{B|{{{1}}}}}'', Chapter {{{2}}}]]<!--
    | i1 = [[Summary:The Queen's Gambit#Chapter {{{2}}}|''The Queen's Gambit'', Chapter {{{2}}}]]
     -->| <span style="color:red">Error: Chapter exceeds 75</span><!--
    | imirillia1 = [[Summary:The Queen's Gambit#Chapter {{{2}}}|''The Queen's Gambit'', Chapter {{{2}}}]]
  -->}}<!--
     | trp = [[Summary:The Ruby Prince#Chapter {{{2}}}|''The Ruby Prince'', Chapter {{{2}}}]]
  -->}}<!--
    | rp = [[Summary:The Ruby Prince#Chapter {{{2}}}|''The Ruby Prince'', Chapter {{{2}}}]]
  -->| <span style="color:red">Error: Missing book title</span><!--
    | i2 = [[Summary:The Ruby Prince#Chapter {{{2}}}|''The Ruby Prince'', Chapter {{{2}}}]]
-->}}<!--
    | imirillia2 = [[Summary:The Ruby Prince#Chapter {{{2}}}|''The Ruby Prince'', Chapter {{{2}}}]]
 
     | twm = [[Summary:The Wanderer's Mark#Chapter {{{2}}}|''The Wanderer's Mark'', Chapter {{{2}}}]]
ADD A REFERENCE FOOTNOTE TO BOOK SUMMARY
    | wm = [[Summary:The Wanderer's Mark#Chapter {{{2}}}|''The Wanderer's Mark'', Chapter {{{2}}}]]
-->| {{#tag:ref|<!--
    | i3 = [[Summary:The Wanderer's Mark#Chapter {{{2}}}|''The Wanderer's Mark'', Chapter {{{2}}}]]
  -->{{#if:{{{1|}}}<!--
     | imirillia3 = [[Summary:The Wanderer's Mark#Chapter {{{2}}}|''The Wanderer's Mark'', Chapter {{{2}}}]]
  -->| {{#switch:{{lc:{{{2}}}}}<!--
    | tq = [[Summary:The Q#Chapter {{{2}}}|''The Q'', Chapter {{{2}}}]]
     -->| prologue = [[Summary:{{B|{{{1}}}}}#Prologue|''{{B|{{{1}}}}}'', Prologue]]<!--
    | q = [[Summary:The Q#Chapter {{{2}}}|''The Q'', Chapter {{{2}}}]]
     -->| epilogue = [[Summary:{{B|{{{1}}}}}#Epilogue|''{{B|{{{1}}}}}'', Epilogue]]<!--
     | {{#ifexpr: {{{2}}} > 0 and {{{2}}} <= 75
     -->| {{#ifexpr: {{{2}}} > 0 and {{{2}}} <= 75<!--
        | [[Summary:{{{1}}}#Chapter_{{{2}}}|''{{{1}}}'', Chapter {{{2}}}]]
    -->| [[Summary:{{B|{{{1}}}}}#Chapter_{{{2}}}|''{{B|{{{1}}}}}'', Chapter {{{2}}}]]<!--
        | <span style="color:red">Error: Chapter exceeds 75</span>
    -->| <span style="color:red">Error: Chapter exceeds 75</span><!--
      }}
    -->}}<!--
  }}
  -->}}<!--
| <span style="color:red">Error: Missing book title</span>}}
  -->| <span style="color:red">Error: Missing book title</span><!--
| name={{{name|{{{1}}}-{{{2}}}}}}
  -->}}<!--
| group={{{group|}}}
  -->| name={{{name|{{{1}}}-{{{2}}}}}}<!--
}}</includeonly><noinclude>
  -->| group={{{group|}}}<!--
-->}}<!--
-->}}</includeonly><noinclude>
== Description ==
== Description ==
{{for|Template:Book infobox|inserting a Summary link in an infobox}}
{{for|Template:Emma ref|linking to a Emma M. Lion chapter summary}}
{{for|Template:Emma ref|linking to a Emma M. Lion chapter summary}}
This template is used to create a reference with a footnote that links to book's chapter summary.
This template is used to create a reference with a footnote that links to a book's chapter summary of a non-Emma M. Lion book. It can also be used to insert a simple link to a chapter summary instead of a reference. For more information on using references, see [[:Help:References]].


== Usage ==
== Usage ==
To use, include {{t|book ref|book|chapter}}
To use, include {{t|book ref|BOOK|CHAPTER}}
* Replace <code>book</code> with the appropriate abbreviation from the table below.
* Replace <code>BOOK</code> with the appropriate abbreviation from the [[:Template:Book ref#Accepted Abbreviations|table below]].
* <code>chapter</code> should be the chapter number, <code>prologue</code>, or <code>epilogue</code>
* <code>CHAPTER</code> should be the chapter number, <code>prologue</code>, or <code>epilogue</code>
* {{{pre}}} is included before the link
 
* {{{post}}} is included after the link
 
* {{{name}}} replaces the generated reference name
{| style="width: 100%; text-align: left; margin: auto;" class="wikitable"
* {{{group}}} sets the reference group
|-
! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Basic Usage</span><br><div style="text-align: left;"><span style="font-weight: normal;">This example displays the basic usage of the template to create a footnote with a link to a specific chapter on a [[:Category:Summary|Summary page]].</span></div>
|-
! width=55%|You Type
!You Get
|-
| style="text-align: left;" |<pre>The Q is located on Gainsford Street.{{book ref|tq|1}}
 
== Notes ==
<references /></pre>
|
The Q is located on Gainsford Street.{{book ref|tq|1}}
 
<span style="display: block; font-size: 1.65em; font-family: serif; font-weight: normal; margin-top: 1em; border-bottom: 1px solid #a2a9b1;">Notes</span>
<references />
|-
! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Nickname a Reference for Repeated Use</span><br><div style="text-align: left;"><span style="font-weight: normal;">If you use the same reference multiple times on the same page, you can assign that reference a nickname by passing <code>name=</code>. Then using {{t|ref}} with the same <code>name=</code> parameter for every other use of that reference.</span></div>
|-
! width=50%|You Type
!You Get
|-
| style="text-align: left;" |<pre>Queen Eleanor studies papers of state in the garden.{{book ref|qg|1|name=qg1}}
 
She is approached by a stranger.{{ref|name=qg1}}
 
== Notes ==
<references /></pre>
|
Queen Eleanor studies papers of state in the garden.{{book ref|qg|1|name=qg1}}
 
She is approached by a stranger.{{ref|name=qg1}}


<span style="display: block; font-size: 1.65em; font-family: serif; font-weight: normal; margin-top: 1em; border-bottom: 1px solid #a2a9b1;">Notes</span>
<references />
|-
! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Plain Link, Instead of Reference</span><br><div style="text-align: left;"><span style="font-weight: normal;">Occasionally, you may find it useful to insert a plain link to a chapter summary instead of a reference footnote. (Such as when inserting a reference in an infobox.) To do this, simply append <code>link=y</code> at the end of the template call.</span></div>
|-
! width=50%|You Type
!You Get
|-
| style="text-align: center;" |<pre>{{book ref|beast|epilogue|link=y}}</pre>
|{{book ref|beast|epilogue|link=y}}
|}
=== Accepted Abbreviations ===
The following abbreviations are accepted, as defined by template {{t|b}}:
{| class="wikitable" width="50%"
{| class="wikitable" width="50%"
! class="title" width="40%" | Book
! class="title" width="40%" | Book
Line 62: Line 108:
| <code>tq</code>, <code>q</code>
| <code>tq</code>, <code>q</code>
|}
|}
== Articles using Template ==
:{{for|Special:WhatLinksHere/{{FULLPAGENAME}}|a full listing|here|pre=This list is limited to 100 pages}}
{{Special:WhatLinksHere/{{FULLPAGENAME}}|namespace=0|limit=100}}{{Special:WhatLinksHere/{{FULLPAGENAME}}|namespace=100|limit=100}}


[[Category: Reference Templates]]
[[Category: Reference Templates]]