Module:Infobox: Difference between revisions
Content added Content deleted
(sync p.infoboxTemplate(frame) from sandbox) |
|||
Line 399: | Line 399: | ||
end |
end |
||
function p. |
function p.parseDataParameters() |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
-- Parse the data parameters in the same order that the old {{infobox}} did, so that |
-- Parse the data parameters in the same order that the old {{infobox}} did, so that |
||
-- references etc. will display in the expected places. Parameters that depend on |
-- references etc. will display in the expected places. Parameters that depend on |
||
-- another parameter are only processed if that parameter is present, to avoid |
-- another parameter are only processed if that parameter is present, to avoid |
||
-- phantom references appearing in article reference lists. |
-- phantom references appearing in article reference lists. |
||
preprocessSingleArg('autoheaders') |
|||
preprocessSingleArg('child') |
preprocessSingleArg('child') |
||
preprocessSingleArg('bodyclass') |
preprocessSingleArg('bodyclass') |
||
Line 455: | Line 448: | ||
args['italic title'] = origArgs['italic title'] -- different behaviour if blank or absent |
args['italic title'] = origArgs['italic title'] -- different behaviour if blank or absent |
||
preprocessSingleArg('decat') |
preprocessSingleArg('decat') |
||
end |
|||
function p.infobox(frame) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
p.parseDataParameters() |
|||
return _infobox() |
|||
end |
|||
function p.infoboxTemplate(frame) |
|||
-- For calling via #invoke within a template |
|||
origArgs = {} |
|||
for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end |
|||
p.parseDataParameters() |
|||
return _infobox() |
return _infobox() |
||
end |
end |