Template:BookShortcut: Difference between revisions

From Guild of Recappers & Podcasters
Jump to navigation Jump to search
(Added initial support for Colin Smythe links)
(Updated to hopefully make the URL for colinsmythe.co.uk automatic)
Line 2: Line 2:
   | ls = ''[[lsb:{{{3|{{{1}}}}}}|{{{1}}}]]''
   | ls = ''[[lsb:{{{3|{{{1}}}}}}|{{{1}}}]]''
   | w = ''[[wikipedia:{{{3|{{{1}}}}}}|{{{1}}}]]''
   | w = ''[[wikipedia:{{{3|{{{1}}}}}}|{{{1}}}]]''
   | cs = ''[https://colinsmythe.co.uk/terry-pratchett/discworld/discworld-novels/{{{3}}} {{{1}}}]''
   | cs = ''[https://colinsmythe.co.uk/terry-pratchett/discworld/discworld-novels/{{lc:{{#replace:{{{3}}}| |-}} {{{1}}}]''
   | ''[[{{{3|{{{1}}}}}}|{{{1}}}]]''
   | ''[[{{{3|{{{1}}}}}}|{{{1}}}]]''
}}</includeonly><noinclude>
}}</includeonly><noinclude>

Revision as of 18:47, 24 April 2022

This template allows our book shortcut templates to link to this wiki, the L-Space wiki or Wikipedia (and may include other options later). It's intended for use inside individual book shortcut templates like {{COM}}, which by default links to {{#switch: {{{1}}}

  | ls = The Colour of Magic
  | w = The Colour of Magic
  | cs = the colour of magic.

A similar template, Template:ShortStoryShortcut, exists for Short Stories.

Usage

The template expects one to three unnamed parameters, in order: {{BookShortcut|Title|Destination|Link name}}

  • The Title is the title of the book, and is always required. If this is the only parameter, it will produce a local link - e.g. {{BookShortcut|Diggers}} produces: {{#switch:
  | ls = Diggers
  | w = Diggers
  | cs = diggers
  • The Destination parameter is required if linking externally to one of the defined alternate locations; the list below documents these. e.g. {{BookShortcut|Diggers|ls}} produces: {{#switch: ls
  | ls = Diggers
  | w = Diggers
  | cs = diggers
  • The Link name parameter is only used when one of the defined external sites uses a different page or article name for this book. If it's omitted, the link will be to the title defined in the first parameter.
    e.g. {{BookShortcut|Diggers|w|The Nome Trilogy#Diggers (1990)}} produces: {{#switch: w
  | ls = Diggers
  | w = Diggers
  | cs = diggers

Destinations supported

These are the abbreviations for destinations you can use as the second parameter when calling this template.

  • ls - the L-Space wiki. This uses the "lsb:" inter-wiki prefix, which adds the "Book:" namespace to the link.
  • w - Wikipedia. This uses the standard inter-wiki link prefix of "wikipedia:".
  • cs - Colin Smythe's official website, at colinsmythe.co.uk. This option always requires an alternate link name matching the way the book is named in the website structure; e.g. {{BookShortcut|Carpe Jugulum|cs|carpe-jugulum}}, which produces a link like this: {{#switch: cs
  | ls = Carpe Jugulum
  | w = Carpe Jugulum
  | cs = carpe jugulum