Module:TestModule: Difference between revisions
AdamZachar (talk | contribs) No edit summary |
AdamZachar (talk | contribs) No edit summary |
||
| Line 91: | Line 91: | ||
return topics.topicID | return topics.topicID | ||
end | |||
function p.topicListByCaseID( frame ) | |||
local topics, errors = mw.ext.externaldata.getExternalData { | |||
source = "CaseData", | |||
query = "topicsByCase", | |||
data = "caseID=case_id", | |||
parameters = frame.args.topicName | |||
} | |||
if topics == nil then return 0 end | |||
local output = "" | |||
output = output .. "<ul>" | |||
for i, topic in ipairs(topics) do | |||
output = output .. " <li>" .. "[[" .. topic.topicName .. "]]" | |||
end | |||
output = output .. "</ul>" | |||
return output | |||
end | end | ||
return p | return p | ||