Anonymous
×
Create a new article
Write your page title here:
We currently have 1,806 articles on Everwind Wiki. Type your article name above or click on one of the titles below and start writing!



Everwind Wiki
1,806Articles

Template:Abblink/doc: Difference between revisions

m 1 revision imported
 
(4 intermediate revisions by the same user not shown)
Line 124: Line 124:


==Examples==
==Examples==
<pre>{{abblink|link=characters|name=character|F42}}</pre>
<pre>{{abblink|link=Snowleaf (subchapter)|name=Snowleaf|SL}}</pre>
results in:
results in:
{{abblink|link=characters|name=character|F42}}
{{abb|SL}}


==Technical==
==Technical==
* Auxiliary template: {{tl|Abb}}
* Auxiliary template: {{tl|Abb}}

Latest revision as of 05:11, 23 July 2021

This page contains usage information for [[{{#sub:Template:Abblink/doc|0|{{#rpos:Template:Abblink/doc|/doc}}}}]].

Template to automatically convert abbreviations into links to book-specific overview pages.

Auxiliary template for Template:Infobox.

Usage

{{abblink|link=link target|name=link name|abbreviations}}

By default, the template takes the parameters link, name and <unnamed 1> (which may contain up to 10 book abbreviations separated by ",") and creates a line with links to the respective page for each abbrevation, separated by "/". The last entry has name (or nothing if name has not been given) appended.

Parameters

Please note that if you do not specify any of the parameters, the template will return an empty string.

{{#replace:{{#replace:{{#replace:{{#replace:<unnamed 1>|| }}| >> | up to }}| // | or }}| ++ |, }}
Book abbreviations; see {{abb}} for valid inputs. The abbreviations are "translated" into full book names. Multiple abbrevations should be separated by the delimiter specified with split by. See below for detailed behavior in combination with the other parameters.
{{#replace:{{#replace:{{#replace:{{#replace:abbmode|| }}| >> | up to }}| // | or }}| ++ |, }}
This is passed down directly to {{abb}}. Only valid input for that template's mode parameter will have any effect. The mode is only applied to the displayed string, and not to the link target.
{{#replace:{{#replace:{{#replace:{{#replace:link|| }}| >> | up to }}| // | or }}| ++ |, }}
This is the second part of the link target (the first being the book name if given). For example, if you want the template to return links which point to the pages "Federation 42 characters", "Outrider characters", "Adoxipham characters" and so forth, this would need to be "characters". See below for detailed behaviour in combination with the other parameters.
(default: "default")
{{#replace:{{#replace:{{#replace:{{#replace:mode|| }}| >> | up to }}| // | or }}| ++ |, }}
This parameter specifies a display mode for the template output.

Available options:

  • default: name is only appended to the last displayed link.
  • fullnames: name is appended to every displayed link.
{{#replace:{{#replace:{{#replace:{{#replace:name|| }}| >> | up to }}| // | or }}| ++ |, }}
This is the second part of the link target (the first being the book name if given). For example, if you want the template to return links which point to the pages "Federation 42 characters", "Outrider characters", "Adoxipham characters" and so forth, this would need to be "characters". See below for detailed behaviour in combination with the other parameters.
{{#replace:{{#replace:{{#replace:{{#replace:prefix ++ suffix|| }}| >> | up to }}| // | or }}| ++ |, }}
Characters/strings which should be added to the beginning (prefix) or end (suffix) of each "section". These are not part of the link itself and can be used e.g. to produce a list instead of the usual single line. Note that spaces at the beginning or end of these strings need to be HTML encoded (& #032; without the space in between), and that you need to use {{!}} if you want to produce a |.
(default: "/")
{{#replace:{{#replace:{{#replace:{{#replace:sep|| }}| >> | up to }}| // | or }}| ++ |, }}
This is the character/string with which the "sections" are separated if you specify more than one abbreviation in <unnamed 1>. Note that spaces at the beginning or end of the string need to be HTML encoded (& #032; without the space in between), and that you need to use {{!}} if you want to produce a |.
(default: ",")
{{#replace:{{#replace:{{#replace:{{#replace:split by|| }}| >> | up to }}| // | or }}| ++ |, }}
This is the character/string which is used as a delimiter for multiple abbrevations in <unnamed 1>, i.e. the character/string which separates the individual abbrevations. Note that spaces at the beginning or end of the string need to be HTML encoded (& #032; without the space in between), and that using | is not recommended.

Behaviour in detail

  • First letter of the result's displayed part will always be uppercase.
  • Setting the first unnamed parameter to "none" results in only the translated version of "none" + "name" (if given) being shown without link.
  • For readability, the table below assumes that sep has not been specified and the default character / is being used.
Parameters given Result
link name unnamed (books) single book multiple books
Template:Yes Template:Yes Template:Yes [[book link|''book'' name]] [[book link|''book'']]/[[book link|''book'']]/[[book link|''book'' name]]
Template:Yes Template:Yes Template:No [[link|name]] [[link|name]]
Template:Yes Template:No Template:Yes [[book link|''book'' link]] [[book link|''book'']]/[[book link|''book'']]/[[book link|''book'']]
Template:Yes Template:No Template:No [[link|link]] [[link|link]]
Template:No Template:Yes Template:Yes [[book|''book'' name]] ''[[book]]''/''[[book]]''/[[book|''book'' name]]
Template:No Template:Yes Template:No name name/name/name
Template:No Template:No Template:Yes ''[[book]]'' ''[[book]]''/''[[book]]''/''[[book]]''
Template:No Template:No Template:No (nothing/empty) (nothing/empty)

Examples

{{abblink|link=Snowleaf (subchapter)|name=Snowleaf|SL}}

results in: Snowleaf

Technical

  • Auxiliary template: {{Abb}}