Module:GetRels: Difference between revisions

From Bodhicitta
((by SublimeText.Mediawiker))
((by SublimeText.Mediawiker))
Line 7: Line 7:
local output = ''
local output = ''


if type(pdata.RelatedTo) == "table" then
if type(pdata) == "table" then
    for _, data in ipairs( pdata.RelatedTo ) do
    for _, data in ipairs( pdata ) do
    output = output .. '<div>' .. data .. '</div>'
    output = output .. '<div>' .. data.RelatedTo .. '</div>'
    end
    end
end
end

Revision as of 12:34, 3 July 2024

Documentation for this module may be created at Module:GetRels/doc

local p = {}

function p.main(frame)

	local pdata = mw.loadData('Module:GetData/relationships')
	local pargs = frame:getParent().args
	local output = ''

	if type(pdata) == "table" then
	    for _, data in ipairs( pdata ) do
	    	output = output .. '<div>' .. data.RelatedTo .. '</div>'
	    end
	end

	return output

end

return p