Jump to content

User:Codemini/Lua Tutorial/Accessing parameters from wikitext

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Codemini (talk | contribs) at 15:39, 26 May 2025 (Accessing parameters in Lua). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Accessing parameters

Functions called by <nowiki|Script error: You must specify a function to call. will be passed a single parameter, that being a frame object. To access the parameters passed to the Script error: You must specify a function to call. 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 Script error: You must specify a function to call.</nowiki> 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