Template:BookShortcut: Difference between revisions

From Guild of Recappers & Podcasters
Jump to navigation Jump to search
(Updated and added documentation)
(Readability)
Line 1: Line 1:
{{#switch: {{{2|}}}
<includeonly>{{#switch: {{{2|}}}
   | ls = ''[[lsb:{{{3|{{{1}}}}}}|{{{1}}}]]''
   | ls = ''[[lsb:{{{3|{{{1}}}}}}|{{{1}}}]]''
   | w = ''[[wikipedia:{{{3|{{{1}}}}}}|{{{1}}}]]''
   | w = ''[[wikipedia:{{{3|{{{1}}}}}}|{{{1}}}]]''
   | ''[[{{{1}}}]]''
   | ''[[{{{1}}}]]''
}}<noinclude>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 <nowiki>{{COM}}</nowiki>, which by default links to {{COM}}.
}}</includeonly><noinclude>
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 <nowiki>{{COM}}</nowiki>, which by default links to {{COM}}.


== Usage ==
== Usage ==
This template expects one to three unnamed parameters, in order: <nowiki>{{BookShortcut|Title|destination|link name}}</nowiki>
The template expects one to three unnamed parameters, in order: <nowiki>{{BookShortcut|Title|Destination|Link name}}</nowiki>


* 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. <nowiki>{{BookShortcut|Diggers}}</nowiki> produces: {{BookShortcut|Diggers}}
* 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. <nowiki>{{BookShortcut|Diggers}}</nowiki> produces: {{BookShortcut|Diggers}}
* The destination parameter is required if linking externally to one of the defined alternate locations; the list below documents these. e.g. <nowiki>{{BookShortcut|Diggers|ls}}</nowiki> produces: {{BookShortcut|Diggers|ls}}
* The '''Destination''' parameter is required if linking externally to one of the defined alternate locations; the list below documents these. e.g. <nowiki>{{BookShortcut|Diggers|ls}}</nowiki> produces: {{BookShortcut|Diggers|ls}}
* 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. <nowiki>{{BookShortcut|Diggers|w|The Nome Trilogy#Diggers (1990)}}</nowiki> produces: {{BookShortcut|Diggers|w|The Nome Trilogy#Diggers (1990)}}
* 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. <nowiki>{{BookShortcut|Diggers|w|The Nome Trilogy#Diggers (1990)}}</nowiki> produces: {{BookShortcut|Diggers|w|The Nome Trilogy#Diggers (1990)}}


The intent is to keep the shortcut templates simple, so all an editor needs to do is specify the destination; the alternate names for L-Space and Wikipedia etc should be specified within the template. This does make creating some of those shortcuts a bit more tedious, but will hopefully be worth it in the long run. Further documentation is coming for how to do this.
The intent is to keep the shortcut templates simple, so all an editor needs to do is specify the destination; the alternate names for L-Space and Wikipedia etc should be specified within the template. This does make creating some of those shortcuts a bit more tedious, but will hopefully be worth it in the long run. Further documentation is coming for how to do this.

Revision as of 21:56, 15 December 2021

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 The Colour of Magic.

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: 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: 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: Diggers

The intent is to keep the shortcut templates simple, so all an editor needs to do is specify the destination; the alternate names for L-Space and Wikipedia etc should be specified within the template. This does make creating some of those shortcuts a bit more tedious, but will hopefully be worth it in the long run. Further documentation is coming for how to do this.

Destinations supported

  • 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:".