Module:TestModule: Difference between revisions

AdamZachar (talk | contribs)
No edit summary
AdamZachar (talk | contribs)
No edit summary
Line 3: Line 3:
function funcRecurseLineage(parentTopic)
function funcRecurseLineage(parentTopic)


--Check for children of the parent topic
  local output = ""
  local output = ""
  local topics, errors = mw.ext.externaldata.getExternalData {
  local topics, errors = mw.ext.externaldata.getExternalData {
Line 11: Line 12:
   }
   }


--If there are children topics, start a new layer of the list
  if topics ~= nil then
  if topics ~= nil then
   output = output .. "<ul>"
   output = output .. "<ul>"
  --For each child topic, add them as a list item, and check for their children
   for i, topic in ipairs(topics) do
   for i, topic in ipairs(topics) do
   output = output .. " <li>" .. "[[" .. topic.topicName .. "]]"
   output = output .. " <li>" .. "[[" .. topic.topicName .. "]]"