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

Module:MediumLink/doc: Difference between revisions

From Castaways Wiki
Jump to navigation Jump to search
(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...")
 
(Blanked the page)
Tag: Blanking
 
Line 1: Line 1:
{{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 [[:Category:Link templates|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 the [[Module:SSB4Link]] instead of this module.
=== Creating a new medium link ===
<syntaxhighlight lang="html">{{#invoke:MediumLink|main|medium=<medium>|link=<link (OPTIONAL)>|short=<short>|shorter=<shorter (OPTIONAL)>|shortest=<shortest (OPTIONAL)>|<mode1>|<mode2>|<mode3>}}</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.
* <code>medium</code> is the name of the medium (e.g. ''Animal Crossing: New Horizons'')
* <code>link</code> is used to provide the direct link to the medium.
* <code>short</code> is the name of the medium under a shorthand name (e.g. ''New Horizons'')
* <code>shorter</code> is the name of the medium under a long acronym name (e.g. ''ACNH'')
* <code>shortest</code> is the name of the medium under a short acronym name (e.g. ''NH'')
* <code>mode1</code>, <code>mode2</code>, and <code>mode3</code> 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 <code>medium</code>, then <code>linkindicator</code> is automatically declared with <code>"🎬 "</code> and appended to the medium name if <code>nolink</code> is not declared.
Note that while <code>shorter</code> and <code>shortest</code> are optional, if they are not declared and the editor tries to declare <code>shorter</code> or <code>shortest</code>, 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|Category:Pages with incorrect usage of link template]] for a list of pages with this error.
=== Example ===
<syntaxhighlight lang="html">{{#invoke:MediumLink|main|medium=Animal Crossing: New Horizons|short=New Horizons|shorter=ACNH|shortest=NH|{{{1|}}}|{{{2|}}}|{{{3|}}}}}</syntaxhighlight>
<syntaxhighlight lang="lua">outputMediumLink("Animal Crossing: New Horizons", , "New Horizons", "ACNH", "NH", mode1, mode2, mode3)</syntaxhighlight>
"''Animal Crossing: New Horizons''" is the <code>medium</code>, with "''New Horizons''" as <code>short</code>, "ACNH" as <code>shorter</code> and "NH" as <code>shortest</code>. Since <code>link</code> is not declared, the default link is "''Animal Crossing: New Horizons''".
When <code>mode1</code> is "nolink" and <code>mode2</code> is "short", the output is: ''New Horizons''
When <code>mode1</code> is "sm" and <code>mode2</code> is "shortest", the output is: <small>[[Animal Crossing: New Horizons|NH]]</small>
</div><includeonly>{{pp|full}}[[Category:Lua modules]]</includeonly>

Latest revision as of 16:50, 30 March 2024