BirbAngry emoji.png
Open Beta is out on IOS/Android, PC & Mac! Play Now for Free!

Module:MediumLink/doc

From Castaways Wiki
< Module:MediumLink
Revision as of 16:50, 30 March 2024 by Jkratz01 (talk | contribs) (Created page with "{{ModuleDocHeader}} == Usage == This module is used to display the link of a medium in the {{SER}} in various different ways. These are then transcluded through link templates, where the editor can switch how they display the link under different conditions. While it can be used inside other Lua modules if <code>require("Module:MediumLink")</code> is added, it is recommended to use through standard templates as is. Note that {{t|SSB4}} uses...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is the documentation page for Module:MediumLink

Template:ModuleDocHeader

Usage

This module is used to display the link of a medium in the Template:SER in various different ways. These are then transcluded through link templates, where the editor can switch how they display the link under different conditions.

While it can be used inside other Lua modules if require("Module:MediumLink") is added, it is recommended to use through standard templates as is. Note that Template:T uses the Module:SSB4Link instead of this module.

Creating a new medium link

<syntaxhighlight lang="html">Lua error in package.lua at line 80: module 'Module:Arguments' not found.</syntaxhighlight> <syntaxhighlight lang="lua">outputMediumLink(medium, link, short, shorter, shortest, mode1, mode2, mode3)</syntaxhighlight>

When creating a new medium link to be used on pages, the following syntax is provided.

  • medium is the name of the medium (e.g. Animal Crossing: New Horizons)
  • link is used to provide the direct link to the medium.
  • short is the name of the medium under a shorthand name (e.g. New Horizons)
  • shorter is the name of the medium under a long acronym name (e.g. ACNH)
  • shortest is the name of the medium under a short acronym name (e.g. NH)
  • mode1, mode2, and mode3 should be reversed for the editors to decide what conditions to use to display the link.

If Gekijōban Doubutsu no Mori is declared as the medium, then linkindicator is automatically declared with "🎬 " and appended to the medium name if nolink is not declared.

Note that while shorter and shortest are optional, if they are not declared and the editor tries to declare shorter or shortest, an error will pop up, describing that they are either using invalid parameters or that the parameters needed to generate the link is empty. See Category:Pages with incorrect usage of link template for a list of pages with this error.

Example

<syntaxhighlight lang="html">Lua error in package.lua at line 80: module 'Module:Arguments' not found.</syntaxhighlight> <syntaxhighlight lang="lua">outputMediumLink("Animal Crossing: New Horizons", , "New Horizons", "ACNH", "NH", mode1, mode2, mode3)</syntaxhighlight>

"Animal Crossing: New Horizons" is the medium, with "New Horizons" as short, "ACNH" as shorter and "NH" as shortest. Since link is not declared, the default link is "Animal Crossing: New Horizons".

When mode1 is "nolink" and mode2 is "short", the output is: New Horizons

When mode1 is "sm" and mode2 is "shortest", the output is: NH