Difference between revisions of "Module:Sandbox/Evad37/X1"
Jump to navigation
Jump to search
blackwiki>Evad37 (testing creating a frame with a specified title to use in parser function / magic words) |
blackwiki>Evad37 (test getting current page's content) |
||
| Line 7: | Line 7: | ||
local FULLPAGENAME = childFrame:preprocess( "{{FULLPAGENAME}}" ) | local FULLPAGENAME = childFrame:preprocess( "{{FULLPAGENAME}}" ) | ||
return FULLPAGENAME | return FULLPAGENAME | ||
| + | end | ||
| + | |||
| + | p.content = function(frame) | ||
| + | local parent = frame:getParent() | ||
| + | local title = mw.title.getCurrentTitle() | ||
| + | local content = title.getContent() | ||
| + | return content | ||
end | end | ||
return p | return p | ||
Revision as of 14:34, 19 June 2020
| 40x40px | This module is a sandbox for testing XFDcloser. It may occasionally have deletion or speedy deletion notices; please do not actually delete it. |
Tests
{{#invoke:Sandbox/Evad37/X1|main}} → Module:Sandbox/Evad37/X1
Lua error: callParserFunction: function "#coordinates" was not found.
Lua error: callParserFunction: function "#coordinates" was not found.
{{#invoke:Sandbox/Evad37/X1|getCoords}} →
Script error: The function "getCoords" does not exist.
-- This module is a sandbox. It is also used for testing XFDcloser
local p = {}
p.main = function(frame)
local childFrame = frame:newChild{ title = "Sandbox", args = {} }
local FULLPAGENAME = childFrame:preprocess( "{{FULLPAGENAME}}" )
return FULLPAGENAME
end
p.content = function(frame)
local parent = frame:getParent()
local title = mw.title.getCurrentTitle()
local content = title.getContent()
return content
end
return p