Module:TestModule: Difference between revisions
AdamZachar (talk | contribs) No edit summary |
AdamZachar (talk | contribs) No edit summary |
||
| Line 1: | Line 1: | ||
local p = {} --p stands for package | local p = {} --p stands for package | ||
function p.recurseLineage( frame ) | |||
local output = frame.args.output | |||
local parentTopic = frame.args.parentTopic | |||
local topics, errors = mw.ext.externaldata.getExternalData { | |||
source = "CaseData", | |||
query = "childrenTopics", | |||
data = "topicName=topic_name", | |||
parameters = parentTopic | |||
} | |||
if topics ~= nil then | |||
output = output .. "<ul>" | |||
for i, topic in ipairs(topics) do | |||
output = output .. " <li>" .. "[[" .. topic.topicName .. "]]" | |||
end | |||
output = output .. "</ul>" | |||
end | |||
return output | |||
end | |||
function p.topicLineage( frame ) | function p.topicLineage( frame ) | ||