Module:TestModule: Difference between revisions
Appearance
AdamZachar (talk | contribs) No edit summary |
AdamZachar (talk | contribs) No edit summary |
||
Line 3: | Line 3: | ||
function p.hello( frame ) | function p.hello( frame ) | ||
return "Hello, world!" | return "Hello, world!" | ||
-- if row.shape == targetShape then | |||
-- output = output .. " <li>" .. "[[" .. row.shape .. "]]" | |||
-- end | |||
end | end | ||
function p.externalDataTest( frame ) | function p.externalDataTest( frame ) | ||
local output = "" | local output = "" | ||
local | local parentCase = frame.args.parentCase | ||
local | local topics, errors = | ||
mw.ext.externaldata. | mw.ext.externaldata.getDbData | ||
{ | { | ||
source = CaseData, | |||
data = { | query = childrenTopics, | ||
data = {topicName = topic_name}, | |||
parameters = parentCase | |||
} | } | ||
output = output .. "<ul>" | output = output .. "<ul>" | ||
for i, | for i, topic in ipairs(topics) do | ||
output = output .. " <li>" .. "[[" .. topic.topicName .. "]]" | |||
end | |||
output = output .. "</ul>" | output = output .. "</ul>" | ||
Revision as of 10:59, 10 June 2025
local p = {} --p stands for package
function p.hello( frame )
return "Hello, world!"
-- if row.shape == targetShape then
-- output = output .. " <li>" .. "[[" .. row.shape .. "]]"
-- end
end
function p.externalDataTest( frame )
local output = ""
local parentCase = frame.args.parentCase
local topics, errors =
mw.ext.externaldata.getDbData
{
source = CaseData,
query = childrenTopics,
data = {topicName = topic_name},
parameters = parentCase
}
output = output .. "<ul>"
for i, topic in ipairs(topics) do
output = output .. " <li>" .. "[[" .. topic.topicName .. "]]"
end
output = output .. "</ul>"
return output
end
return p