Jump to content

Module:Shortcut/doc

From Wikivoyage

Template:Lua sidebar This module makes a box showing the shortcut links to a page.

Usage

[edit]

From wikitext

[edit]

From wikitext, this module should be called from a template, usually {{Shortcut}}. Please see the template page for documentation. However, it can also be called using the syntax {{#invoke:shortcut|main|arguments}}.

From Lua

[edit]

To use this module from Lua, first load it.

local mShortcut = require('Module:Shortcut')

Then you can create shortcut boxes with the following syntax:

mShortcut._main(shortcuts, options, frame, cfg)
  • shortcuts: an array of shortcut page names (required)
  • options: a table of options with support for the following subkeys
    • msg: a message to leave after the list of shortcuts
    • category: if set to a "falsy" Boolean value (one regarded as false by Module:Yesno, such as "no"), categorization is suppressed
  • frame: is a optional frame object, only intended to be used internally
  • cfg: is a table of optional config values, only intended for testing

Technical details

[edit]

This module has a configuration file at Module:Shortcut/config. It can be used to translate this module into different languages or to change details like category names.