User:Codemini/Lua Tutorial/Accessing parameters from wikitext
Appearance
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