Jump to content

User:Codemini/Lua Tutorial/Accessing parameters from wikitext

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by Codemini (talk | contribs) at 15:39, 26 May 2025 (Corrected an error). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Accessing parameters

Functions called by {{#invoke:}} will be passed a single parameter, that being a frame object. To access the parameters passed to the {{#invoke:}} code will typically use the args table of that frame object. It's also possible to access the parameter passed to the template containing the {{#invoke:}} by using frame:getParent() and accessing that frame's args. The frame object is also used to access context-specific features of the wikitext parser, such as calling parser functions, expanding templates, and expanding arbitrary wikitext strings. Example:

  frame.args.text
-- which will passed to the {{#invoke:}} and accessed using {{#invoke:Example|text=}} anywhere on a non-module page

Previous Next