Module:Infobox: Difference between revisions
Appearance
(1) return templatestyles when child=yes, (2) move templatestyles and categories before </tr> to avoid creating empty cells (see thread on talk page) |
move subbox to templatestyles, still working on the other 4k. will remove from common.css Soon |
||
Line 394: | Line 394: | ||
Loads the templatestyles for the infobox. | Loads the templatestyles for the infobox. | ||
TODO: | TODO: FINISH loading base templatestyles here rather than in | ||
MediaWiki:Common.css. There are 4-5000 pages with 'raw' infobox tables. | |||
tables. See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :). | See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :). | ||
When we do this we should clean up the inline CSS below too. | When we do this we should clean up the inline CSS below too. | ||
Will have to do some bizarre conversion category like with sidebar. | Will have to do some bizarre conversion category like with sidebar. | ||
]=] | ]=] | ||
local function loadTemplateStyles() | local function loadTemplateStyles() | ||
local frame = mw.getCurrentFrame() | local frame = mw.getCurrentFrame() | ||
-- See function description | -- See function description | ||
local base_templatestyles = frame:extensionTag{ | |||
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' } | |||
} | |||
local templatestyles = '' | local templatestyles = '' | ||
if args['templatestyles'] then templatestyles = frame:extensionTag{ | if args['templatestyles'] then templatestyles = frame:extensionTag{ | ||
Line 428: | Line 428: | ||
return table.concat({ | return table.concat({ | ||
base_templatestyles, -- see function description | |||
templatestyles, | templatestyles, | ||
child_templatestyles, | child_templatestyles, | ||
grandchild_templatestyles | grandchild_templatestyles | ||
}) | }) | ||
end | end | ||