Module:NavboxUpgraded: Difference between revisions
EnWikiAdmin (talk | contribs) No edit summary |
EnWikiAdmin (talk | contribs) No edit summary |
||
Line 44: | Line 44: | ||
navbox | navbox | ||
:addClass('navbox') | :addClass('navbox') | ||
-- [Rest of your styling code] | |||
-- Handle title | -- Handle title | ||
-- [Existing code for title] | |||
-- Handle above | -- Handle above | ||
-- [Existing code for above] | |||
-- Handle groups and lists | -- Handle groups and lists | ||
Line 85: | Line 61: | ||
-- Group heading | -- Group heading | ||
if group then | if group then | ||
-- [Existing code for groupCell] | |||
end | end | ||
Line 99: | Line 69: | ||
listCell | listCell | ||
:addClass('navbox-list') | :addClass('navbox-list') | ||
-- [Rest of your styling code] | |||
-- | if list == 'subgroup' then | ||
-- Process subgroup | |||
local childArgs = {} | |||
listCell:wikitext( | for k, v in pairs(args) do | ||
local prefix = 'list' .. i .. '_' | |||
if k:sub(1, #prefix) == prefix then | |||
childArgs[k:sub(#prefix + 1)] = v | |||
end | |||
end | |||
local subgroupContent = p._navboxDesktop(childArgs) | |||
listCell:wikitext(subgroupContent) | |||
else | else | ||
listCell:tag('ul') | listCell:tag('ul') | ||
:addClass('navbox-list') | :addClass('navbox-list') | ||
-- [Rest of your styling code] | |||
:wikitext(list) | :wikitext(list) | ||
end | end | ||
Line 119: | Line 93: | ||
-- Handle below | -- Handle below | ||
-- [Existing code for below] | |||
return tostring(navbox) | return tostring(navbox) | ||
end | end | ||
-- Function to generate the mobile navbox | -- Function to generate the mobile navbox |