Title: Module:Infobox - freem URL Source: https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox Published Time: Thu, 30 Jul 2026 23:54:41 GMT Markdown Content: [](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#) - [x] * [Home](https://freemwiki.com/wiki/Main_Page) * [Random](https://freemwiki.com/wiki/Special:Random) * [Log in](https://freemwiki.com/index.php?title=Special:UserLogin&returnto=Module%3AInfobox&returntoquery=mobileaction%3Dtoggle_view_mobile%26oldid%3D579726) * [Settings](https://freemwiki.com/index.php?title=Special:MobileOptions&returnto=Module%3AInfobox) * [About](https://freemwiki.com/wiki/About) * [Terms of Service](https://freemwiki.com/wiki/Terms_of_Service) [freem](https://freemwiki.com/wiki/Main_Page) Search # Module:Infobox * [Language](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox "Language") * [Watch](https://freemwiki.com/index.php?title=Special:UserLogin&returnto=Module%3AInfobox) * [Edit](https://freemwiki.com/index.php?title=Module:Infobox&action=edit) Revision as of 06:18, 21 October 2025 by [Lukegao](https://freemwiki.com/index.php?title=User:Lukegao&action=edit&redlink=1 "User:Lukegao (page does not exist)")([talk](https://freemwiki.com/index.php?title=User_talk:Lukegao&action=edit&redlink=1 "User talk:Lukegao (page does not exist)") | [contribs](https://freemwiki.com/wiki/Special:Contributions/Lukegao "Special:Contributions/Lukegao"))(1 revision imported) ([diff](https://freemwiki.com/index.php?title=Module:Infobox&diff=prev&oldid=579726 "Module:Infobox")) [← Older revision](https://freemwiki.com/index.php?title=Module:Infobox&direction=prev&oldid=579726 "Module:Infobox") | Latest revision (diff) | Newer revision → (diff) _Documentation for this module may be created at [Module:Infobox/doc](https://freemwiki.com/index.php?title=Module:Infobox/doc&action=edit&redlink=1 "Module:Infobox/doc (page does not exist)")_ [](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-1)local p = {}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-2)local args = {}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-3)local origArgs = {}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-4)local root[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-5)local empty_row_categories = {}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-6)local category_in_empty_row_pattern = '%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]'[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-7)local has_rows = false[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-8)local lists = {[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-9)plainlist_t = {[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-10)patterns = {[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-11)'^plainlist$',[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-12)'%splainlist$',[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-13)'^plainlist%s',[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-14)'%splainlist%s'[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-15)},[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-16)found = false,[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-17)styles = 'Plainlist/styles.css'[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-18)},[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-19)hlist_t = {[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-20)patterns = {[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-21)'^hlist$',[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-22)'%shlist$',[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-23)'^hlist%s',[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-24)'%shlist%s'[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-25)},[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-26)found = false,[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-27)styles = 'Hlist/styles.css'[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-28)}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-29)}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-30)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-31)local function has_list_class(args_to_check)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-32)for _, list in pairs(lists) do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-33)if not list.found then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-34)for _, arg in pairs(args_to_check) do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-35)for _, pattern in ipairs(list.patterns) do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-36)if mw.ustring.find(arg or '', pattern) then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-37)list.found = true[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-38)break[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-39)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-40)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-41)if list.found then break end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-42)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-43)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-44)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-45)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-46)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-47)local function fixChildBoxes(sval, tt)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-48)local function notempty( s ) return s and s:match( '%S' ) end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-49)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-50)if notempty(sval) then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-51)local marker = ''[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-52)local s = sval[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-53)-- start moving templatestyles and categories inside of table rows[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-54)local slast = ''[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-55)while slast ~= s do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-56)slast = s[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-57)s = mw.ustring.gsub(s, '(%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-58)s = mw.ustring.gsub(s, '(%s*)(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)', '%2%1')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-59)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-60)-- end moving templatestyles and categories inside of table rows[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-61)s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-62)s = mw.ustring.gsub(s, '()', '%1' .. marker)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-63)if s:match(marker) then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-64)s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-65)s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-66)s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-67)s = mw.ustring.gsub(s, '(%s*)' .. marker, '%1')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-68)s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-69)s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-70)s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-71)s = mw.ustring.gsub(s, marker .. '(%s*)', '%1')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-72)s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-73)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-74)if s:match(marker) then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-75)local subcells = mw.text.split(s, marker)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-76)s = ''[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-77)for k = 1, #subcells do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-78)if k == 1 then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-79)s = s .. subcells[k] .. ''[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-80)elseif k == #subcells then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-81)local rowstyle = ' style="display:none"'[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-82)if notempty(subcells[k]) then rowstyle = ''end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-83)s = s .. '<' .. tt .. ' colspan=2>\n' ..[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-84)subcells[k][](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-85)elseif notempty(subcells[k]) then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-86)if (k % 2) == 0 then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-87)s = s .. subcells[k][](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-88)else[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-89)s = s .. '<' .. tt .. ' colspan=2>\n' ..[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-90)subcells[k] .. ''[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-91)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-92)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-93)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-94)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-95)-- the next two lines add a newline at the end of lists for the PHP parser[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-96)-- [[[Special:Diff/849054481]]](https://freemwiki.com/wiki/Special:Diff/849054481 "Special:Diff/849054481")[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-97)-- remove when [[[:phab:T191516]]](https://freemwiki.com/wiki/Phab:T191516 "Phab:T191516") is fixed or OBE[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-98)s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-99)s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-100)s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-101)s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-102)return s[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-103)else[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-104)return sval[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-105)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-106)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-107)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-108)-- Cleans empty tables[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-109)local function cleanInfobox()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-110)root = tostring(root)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-111)if has_rows == false then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-112)root = mw.ustring.gsub(root, ']*>%s*', '')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-113)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-114)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-115)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-116)-- Returns the union of the values of two tables, as a sequence.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-117)local function union(t1, t2)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-118)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-119)local vals = {}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-120)for k, v in pairs(t1) do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-121)vals[v] = true[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-122)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-123)for k, v in pairs(t2) do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-124)vals[v] = true[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-125)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-126)local ret = {}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-127)for k, v in pairs(vals) do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-128)table.insert(ret, k)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-129)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-130)return ret[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-131)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-132)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-133)-- Returns a table containing the numbers of the arguments that exist[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-134)-- for the specified prefix. For example, if the prefix was 'data', and[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-135)-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-136)local function getArgNums(prefix)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-137)local nums = {}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-138)for k, v in pairs(args) do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-139)local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-140)if num then table.insert(nums, tonumber(num)) end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-141)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-142)table.sort(nums)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-143)return nums[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-144)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-145)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-146)-- Adds a row to the infobox, with either a header cell[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-147)-- or a label/data cell combination.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-148)local function addRow(rowArgs)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-149)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-150)if rowArgs.header and rowArgs.header ~= '_BLANK_' then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-151)has_rows = true[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-152)has_list_class({ rowArgs.rowclass, rowArgs.class, args.headerclass })[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-153)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-154)root[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-155):tag('tr')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-156):addClass(rowArgs.rowclass)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-157):cssText(rowArgs.rowstyle)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-158):tag('th')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-159):attr('colspan', '2')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-160):addClass('infobox-header')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-161):addClass(rowArgs.class)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-162):addClass(args.headerclass)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-163)-- @deprecated next; target .infobox- .infobox-header[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-164):cssText(args.headerstyle)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-165):cssText(rowArgs.rowcellstyle)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-166):wikitext(fixChildBoxes(rowArgs.header, 'th'))[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-167)if rowArgs.data then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-168)root:wikitext([](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-169)'[[Category:Pages using infobox templates with ignored data cells]]'[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-170))[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-171)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-172)elseif rowArgs.data and rowArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-173)has_rows = true[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-174)has_list_class({ rowArgs.rowclass, rowArgs.class })[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-175)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-176)local row = root:tag('tr')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-177)row:addClass(rowArgs.rowclass)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-178)row:cssText(rowArgs.rowstyle)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-179)if rowArgs.label then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-180)row[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-181):tag('th')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-182):attr('scope', 'row')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-183):addClass('infobox-label')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-184)-- @deprecated next; target .infobox- .infobox-label[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-185):cssText(args.labelstyle)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-186):cssText(rowArgs.rowcellstyle)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-187):wikitext(rowArgs.label)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-188):done()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-189)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-190)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-191)local dataCell = row:tag('td')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-192)dataCell[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-193):attr('colspan', not rowArgs.label and '2' or nil)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-194):addClass(not rowArgs.label and 'infobox-full-data' or 'infobox-data')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-195):addClass(rowArgs.class)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-196)-- @deprecated next; target .infobox- .infobox(-full)-data[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-197):cssText(rowArgs.datastyle)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-198):cssText(rowArgs.rowcellstyle)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-199):wikitext(fixChildBoxes(rowArgs.data, 'td'))[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-200)else[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-201)table.insert(empty_row_categories, rowArgs.data or '')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-202)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-203)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-204)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-205)local function renderTitle()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-206)if not args.title then return end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-207)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-208)has_rows = true[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-209)has_list_class({args.titleclass})[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-210)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-211)root[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-212):tag('caption')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-213):addClass('infobox-title')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-214):addClass(args.titleclass)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-215)-- @deprecated next; target .infobox- .infobox-title[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-216):cssText(args.titlestyle)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-217):wikitext(args.title)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-218)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-219)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-220)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-221)local function renderAboveRow()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-222)if not args.above then return end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-223)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-224)has_rows = true[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-225)has_list_class({ args.aboveclass })[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-226)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-227)root[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-228):tag('tr')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-229):tag('th')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-230):attr('colspan', '2')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-231):addClass('infobox-above')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-232):addClass(args.aboveclass)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-233)-- @deprecated next; target .infobox- .infobox-above[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-234):cssText(args.abovestyle)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-235):wikitext(fixChildBoxes(args.above,'th'))[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-236)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-237)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-238)local function renderBelowRow()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-239)if not args.below then return end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-240)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-241)has_rows = true[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-242)has_list_class({ args.belowclass })[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-243)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-244)root[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-245):tag('tr')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-246):tag('td')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-247):attr('colspan', '2')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-248):addClass('infobox-below')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-249):addClass(args.belowclass)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-250)-- @deprecated next; target .infobox- .infobox-below[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-251):cssText(args.belowstyle)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-252):wikitext(fixChildBoxes(args.below,'td'))[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-253)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-254)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-255)local function addSubheaderRow(subheaderArgs)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-256)if subheaderArgs.data and[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-257)subheaderArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-258)has_rows = true[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-259)has_list_class({ subheaderArgs.rowclass, subheaderArgs.class })[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-260)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-261)local row = root:tag('tr')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-262)row:addClass(subheaderArgs.rowclass)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-263)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-264)local dataCell = row:tag('td')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-265)dataCell[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-266):attr('colspan', '2')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-267):addClass('infobox-subheader')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-268):addClass(subheaderArgs.class)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-269):cssText(subheaderArgs.datastyle)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-270):cssText(subheaderArgs.rowcellstyle)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-271):wikitext(fixChildBoxes(subheaderArgs.data, 'td'))[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-272)else[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-273)table.insert(empty_row_categories, subheaderArgs.data or '')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-274)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-275)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-276)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-277)local function renderSubheaders()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-278)if args.subheader then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-279)args.subheader1 = args.subheader[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-280)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-281)if args.subheaderrowclass then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-282)args.subheaderrowclass1 = args.subheaderrowclass[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-283)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-284)local subheadernums = getArgNums('subheader')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-285)for k, num in ipairs(subheadernums) do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-286)addSubheaderRow({[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-287)data = args['subheader' .. tostring(num)],[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-288)-- @deprecated next; target .infobox- .infobox-subheader[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-289)datastyle = args.subheaderstyle,[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-290)rowcellstyle = args['subheaderstyle' .. tostring(num)],[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-291)class = args.subheaderclass,[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-292)rowclass = args['subheaderrowclass' .. tostring(num)][](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-293)})[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-294)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-295)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-296)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-297)local function addImageRow(imageArgs)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-298)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-299)if imageArgs.data and[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-300)imageArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-301)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-302)has_rows = true[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-303)has_list_class({ imageArgs.rowclass, imageArgs.class })[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-304)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-305)local row = root:tag('tr')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-306)row:addClass(imageArgs.rowclass)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-307)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-308)local dataCell = row:tag('td')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-309)dataCell[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-310):attr('colspan', '2')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-311):addClass('infobox-image')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-312):addClass(imageArgs.class)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-313):cssText(imageArgs.datastyle)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-314):wikitext(fixChildBoxes(imageArgs.data, 'td'))[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-315)else[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-316)table.insert(empty_row_categories, imageArgs.data or '')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-317)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-318)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-319)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-320)local function renderImages()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-321)if args.image then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-322)args.image1 = args.image[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-323)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-324)if args.caption then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-325)args.caption1 = args.caption[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-326)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-327)local imagenums = getArgNums('image')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-328)for k, num in ipairs(imagenums) do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-329)local caption = args['caption' .. tostring(num)][](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-330)local data = mw.html.create():wikitext(args['image' .. tostring(num)])[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-331)if caption then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-332)data[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-333):tag('div')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-334):addClass('infobox-caption')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-335)-- @deprecated next; target .infobox- .infobox-caption[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-336):cssText(args.captionstyle)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-337):wikitext(caption)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-338)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-339)addImageRow({[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-340)data = tostring(data),[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-341)-- @deprecated next; target .infobox- .infobox-image[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-342)datastyle = args.imagestyle,[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-343)class = args.imageclass,[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-344)rowclass = args['imagerowclass' .. tostring(num)][](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-345)})[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-346)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-347)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-348)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-349)-- When autoheaders are turned on, preprocesses the rows[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-350)local function preprocessRows()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-351)if not args.autoheaders then return end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-352)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-353)local rownums = union(getArgNums('header'), getArgNums('data'))[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-354)table.sort(rownums)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-355)local lastheader[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-356)for k, num in ipairs(rownums) do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-357)if args['header' .. tostring(num)] then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-358)if lastheader then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-359)args['header' .. tostring(lastheader)] = nil[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-360)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-361)lastheader = num[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-362)elseif args['data' .. tostring(num)] and[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-363)args['data' .. tostring(num)]:gsub([](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-364)category_in_empty_row_pattern, ''[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-365)):match('^%S') then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-366)local data = args['data' .. tostring(num)][](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-367)if data:gsub(category_in_empty_row_pattern, ''):match('%S') then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-368)lastheader = nil[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-369)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-370)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-371)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-372)if lastheader then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-373)args['header' .. tostring(lastheader)] = nil[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-374)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-375)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-376)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-377)-- Gets the union of the header and data argument numbers,[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-378)-- and renders them all in order[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-379)local function renderRows()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-380)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-381)local rownums = union(getArgNums('header'), getArgNums('data'))[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-382)table.sort(rownums)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-383)for k, num in ipairs(rownums) do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-384)addRow({[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-385)header = args['header' .. tostring(num)],[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-386)label = args['label' .. tostring(num)],[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-387)data = args['data' .. tostring(num)],[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-388)datastyle = args.datastyle,[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-389)class = args['class' .. tostring(num)],[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-390)rowclass = args['rowclass' .. tostring(num)],[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-391)-- @deprecated next; target .infobox- rowclass[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-392)rowstyle = args['rowstyle' .. tostring(num)],[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-393)rowcellstyle = args['rowcellstyle' .. tostring(num)][](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-394)})[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-395)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-396)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-397)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-398)local function renderNavBar()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-399)if not args.name then return end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-400)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-401)has_rows = true[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-402)root[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-403):tag('tr')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-404):tag('td')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-405):attr('colspan', '2')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-406):addClass('infobox-navbar')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-407):wikitext(require(['Module:Navbar'](https://freemwiki.com/wiki/Module:Navbar))._navbar{[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-408)args.name,[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-409)mini = 1,[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-410)})[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-411)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-412)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-413)local function renderItalicTitle()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-414)local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-415)if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-416)root:wikitext(require(['Module:Italic title'](https://freemwiki.com/wiki/Module:Italic_title))._main({}))[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-417)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-418)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-419)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-420)-- Categories in otherwise empty rows are collected in empty_row_categories.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-421)-- This function adds them to the module output. It is not affected by[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-422)-- args.decat because this module should not prevent module-external categories[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-423)-- from rendering.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-424)local function renderEmptyRowCategories()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-425)for _, s in ipairs(empty_row_categories) do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-426)root:wikitext(s)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-427)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-428)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-429)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-430)-- Render tracking categories. args.decat == turns off tracking categories.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-431)local function renderTrackingCategories()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-432)if args.decat == 'yes' then return end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-433)if args.child == 'yes' then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-434)if args.title then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-435)root:wikitext([](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-436)'[[Category:Pages using embedded infobox templates with the title parameter]]'[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-437))[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-438)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-439)elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-440)root:wikitext('[[Category:Articles using infobox templates with no data rows]]')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-441)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-442)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-443)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-444)--[=[[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-445)Loads the templatestyles for the infobox.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-446)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-447)TODO: FINISH loading base templatestyles here rather than in[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-448)MediaWiki:Common.css. There are 4-5000 pages with 'raw' infobox tables.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-449)See [[[Mediawiki_talk:Common.css/to_do#Infobox]]](https://freemwiki.com/wiki/MediaWiki_talk:Common.css/to_do "MediaWiki talk:Common.css/to do") and/or come help :).[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-450)When we do this we should clean up the inline CSS below too.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-451)Will have to do some bizarre conversion category like with sidebar.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-452)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-453)]=][](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-454)local function loadTemplateStyles()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-455)local frame = mw.getCurrentFrame()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-456)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-457)local hlist_templatestyles = ''[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-458)if lists.hlist_t.found then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-459)hlist_templatestyles = frame:extensionTag{[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-460)name = 'templatestyles', args = { src = lists.hlist_t.styles }[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-461)}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-462)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-463)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-464)local plainlist_templatestyles = ''[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-465)if lists.plainlist_t.found then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-466)plainlist_templatestyles = frame:extensionTag{[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-467)name = 'templatestyles', args = { src = lists.plainlist_t.styles }[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-468)}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-469)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-470)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-471)-- See function description[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-472)local base_templatestyles = frame:extensionTag{[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-473)name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-474)}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-475)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-476)local templatestyles = ''[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-477)if args['templatestyles'] then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-478)templatestyles = frame:extensionTag{[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-479)name = 'templatestyles', args = { src = args['templatestyles'] }[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-480)}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-481)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-482)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-483)local child_templatestyles = ''[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-484)if args['child templatestyles'] then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-485)child_templatestyles = frame:extensionTag{[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-486)name = 'templatestyles', args = { src = args['child templatestyles'] }[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-487)}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-488)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-489)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-490)local grandchild_templatestyles = ''[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-491)if args['grandchild templatestyles'] then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-492)grandchild_templatestyles = frame:extensionTag{[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-493)name = 'templatestyles', args = { src = args['grandchild templatestyles'] }[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-494)}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-495)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-496)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-497)return table.concat({[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-498)-- hlist -> plainlist -> base is best-effort to preserve old Common.css ordering.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-499)-- this ordering is not a guarantee because the rows of interest invoking[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-500)-- each class may not be on a specific page[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-501)hlist_templatestyles,[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-502)plainlist_templatestyles,[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-503)base_templatestyles,[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-504)templatestyles,[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-505)child_templatestyles,[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-506)grandchild_templatestyles[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-507)})[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-508)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-509)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-510)-- common functions between the child and non child cases[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-511)local function structure_infobox_common()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-512)renderSubheaders()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-513)renderImages()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-514)preprocessRows()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-515)renderRows()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-516)renderBelowRow()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-517)renderNavBar()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-518)renderItalicTitle()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-519)renderEmptyRowCategories()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-520)renderTrackingCategories()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-521)cleanInfobox()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-522)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-523)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-524)-- Specify the overall layout of the infobox, with special settings if the[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-525)-- infobox is used as a 'child' inside another infobox.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-526)local function _infobox()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-527)if args.child ~= 'yes' then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-528)root = mw.html.create('table')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-529)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-530)root[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-531):addClass(args.subbox == 'yes' and 'infobox-subbox' or 'infobox')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-532):addClass(args.bodyclass)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-533)-- @deprecated next; target .infobox-[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-534):cssText(args.bodystyle)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-535)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-536)has_list_class({ args.bodyclass })[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-537)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-538)renderTitle()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-539)renderAboveRow()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-540)else[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-541)root = mw.html.create()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-542)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-543)root[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-544):wikitext(args.title)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-545)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-546)structure_infobox_common()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-547)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-548)return loadTemplateStyles() .. root[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-549)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-550)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-551)-- If the argument exists and isn't blank, add it to the argument table.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-552)-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-553)local function preprocessSingleArg(argName)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-554)if origArgs[argName] and origArgs[argName] ~= '' then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-555)args[argName] = origArgs[argName][](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-556)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-557)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-558)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-559)-- Assign the parameters with the given prefixes to the args table, in order, in[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-560)-- batches of the step size specified. This is to prevent references etc. from[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-561)-- appearing in the wrong order. The prefixTable should be an array containing[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-562)-- tables, each of which has two possible fields, a "prefix" string and a[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-563)-- "depend" table. The function always parses parameters containing the "prefix"[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-564)-- string, but only parses parameters in the "depend" table if the prefix[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-565)-- parameter is present and non-blank.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-566)local function preprocessArgs(prefixTable, step)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-567)if type(prefixTable) ~= 'table' then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-568)error("Non-table value detected for the prefix table", 2)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-569)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-570)if type(step) ~= 'number' then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-571)error("Invalid step value detected", 2)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-572)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-573)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-574)-- Get arguments without a number suffix, and check for bad input.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-575)for i,v in ipairs(prefixTable) do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-576)if type(v) ~= 'table' or type(v.prefix) ~= "string" or[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-577)(v.depend and type(v.depend) ~= 'table') then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-578)error('Invalid input detected to preprocessArgs prefix table', 2)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-579)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-580)preprocessSingleArg(v.prefix)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-581)-- Only parse the depend parameter if the prefix parameter is present[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-582)-- and not blank.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-583)if args[v.prefix] and v.depend then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-584)for j, dependValue in ipairs(v.depend) do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-585)if type(dependValue) ~= 'string' then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-586)error('Invalid "depend" parameter value detected in preprocessArgs')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-587)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-588)preprocessSingleArg(dependValue)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-589)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-590)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-591)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-592)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-593)-- Get arguments with number suffixes.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-594)local a = 1 -- Counter variable.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-595)local moreArgumentsExist = true[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-596)while moreArgumentsExist == true do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-597)moreArgumentsExist = false[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-598)for i = a, a + step - 1 do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-599)for j,v in ipairs(prefixTable) do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-600)local prefixArgName = v.prefix .. tostring(i)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-601)if origArgs[prefixArgName] then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-602)-- Do another loop if any arguments are found, even blank ones.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-603)moreArgumentsExist = true[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-604)preprocessSingleArg(prefixArgName)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-605)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-606)-- Process the depend table if the prefix argument is present[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-607)-- and not blank, or we are processing "prefix1" and "prefix" is[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-608)-- present and not blank, and if the depend table is present.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-609)if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-610)for j,dependValue in ipairs(v.depend) do[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-611)local dependArgName = dependValue .. tostring(i)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-612)preprocessSingleArg(dependArgName)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-613)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-614)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-615)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-616)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-617)a = a + step[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-618)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-619)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-620)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-621)-- Parse the data parameters in the same order that the old {{[infobox](https://freemwiki.com/wiki/Template:Infobox "Template:Infobox")}} did, so[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-622)-- that references etc. will display in the expected places. Parameters that[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-623)-- depend on another parameter are only processed if that parameter is present,[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-624)-- to avoid phantom references appearing in article reference lists.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-625)local function parseDataParameters()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-626)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-627)preprocessSingleArg('autoheaders')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-628)preprocessSingleArg('child')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-629)preprocessSingleArg('bodyclass')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-630)preprocessSingleArg('subbox')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-631)preprocessSingleArg('bodystyle')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-632)preprocessSingleArg('title')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-633)preprocessSingleArg('titleclass')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-634)preprocessSingleArg('titlestyle')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-635)preprocessSingleArg('above')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-636)preprocessSingleArg('aboveclass')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-637)preprocessSingleArg('abovestyle')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-638)preprocessArgs({[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-639){prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-640)}, 10)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-641)preprocessSingleArg('subheaderstyle')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-642)preprocessSingleArg('subheaderclass')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-643)preprocessArgs({[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-644){prefix = 'image', depend = {'caption', 'imagerowclass'}}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-645)}, 10)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-646)preprocessSingleArg('captionstyle')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-647)preprocessSingleArg('imagestyle')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-648)preprocessSingleArg('imageclass')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-649)preprocessArgs({[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-650){prefix = 'header'},[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-651){prefix = 'data', depend = {'label'}},[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-652){prefix = 'rowclass'},[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-653){prefix = 'rowstyle'},[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-654){prefix = 'rowcellstyle'},[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-655){prefix = 'class'}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-656)}, 50)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-657)preprocessSingleArg('headerclass')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-658)preprocessSingleArg('headerstyle')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-659)preprocessSingleArg('labelstyle')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-660)preprocessSingleArg('datastyle')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-661)preprocessSingleArg('below')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-662)preprocessSingleArg('belowclass')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-663)preprocessSingleArg('belowstyle')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-664)preprocessSingleArg('name')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-665)-- different behaviour for italics if blank or absent[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-666)args['italic title'] = origArgs['italic title'][](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-667)preprocessSingleArg('decat')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-668)preprocessSingleArg('templatestyles')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-669)preprocessSingleArg('child templatestyles')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-670)preprocessSingleArg('grandchild templatestyles')[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-671)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-672)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-673)-- If called via #invoke, use the args passed into the invoking template.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-674)-- Otherwise, for testing purposes, assume args are being passed directly in.[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-675)function p.infobox(frame)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-676)if frame == mw.getCurrentFrame() then[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-677)origArgs = frame:getParent().args[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-678)else[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-679)origArgs = frame[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-680)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-681)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-682)parseDataParameters()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-683)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-684)return _infobox()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-685)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-686)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-687)-- For calling via #invoke within a template[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-688)function p.infoboxTemplate(frame)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-689)origArgs = {}[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-690)for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-691)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-692)parseDataParameters()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-693)[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-694)return _infobox()[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-695)end[](https://freemwiki.com/index.php?mobileaction=toggle_view_mobile&oldid=579726&title=Module%3AInfobox#L-696)return p Retrieved from "[https://freemwiki.com/index.php?title=Module:Infobox&oldid=579726](https://freemwiki.com/index.php?title=Module:Infobox&oldid=579726)" [**Last edited 9 months ago** by Lukegao](https://freemwiki.com/index.php?title=Module:Infobox&action=history) #### Languages This page is not available in other languages. freem * This page was last edited on 21 October 2025, at 06:18. * Content is available under [Creative Commons Attribution-ShareAlike 4.0](https://creativecommons.org/licenses/by-sa/4.0/) unless otherwise noted. FreemWiki is operated by **FINGERPOWER DIGITAL TECHNOLOGY LLC** (Colorado, Entity ID 20221978727). * [Privacy Policy](https://freemwiki.com/wiki/Privacy_Policy) * [About](https://freemwiki.com/wiki/About) * [Terms of Service](https://freemwiki.com/wiki/Terms_of_Service) * [Desktop](https://freemwiki.com/index.php?title=Module:Infobox&mobileaction=toggle_view_desktop&oldid=579726)