Difference between revisions of "Module:InfoboxAlt"

From Railway Operation Simulator Wiki
Jump to navigation Jump to search
(Create Alternative Infobox to fix error issue)
 
Line 1: Line 1:
 
local p = {}
 
local p = {}
  
function p.main(frame)
+
function p.main()
local args = frame:getParent().args
+
return "InfoboxAlt OK"
local title = args.title or args.name or ""
 
 
 
local rows = {}
 
 
 
for k, v in pairs(args) do
 
if k ~= "title" and k ~= "name" and v ~= "" then
 
table.insert(rows,
 
string.format(
 
'<tr><th class="infobox-label">%s</th><td class="infobox-data">%s</td></tr>',
 
k,
 
v
 
)
 
)
 
end
 
end
 
 
 
table.sort(rows)
 
 
 
return string.format([[
 
<table class="infobox">
 
<caption class="infobox-title">%s</caption>
 
%s
 
</table>
 
]], title, table.concat(rows, "\n"))
 
 
end
 
end
  
 
return p
 
return p

Revision as of 11:18, 4 January 2026

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

local p = {}

function p.main()
	return "InfoboxAlt OK"
end

return p