Module:Infobox
Appearance
Documentation for this module may be created at Module:Infobox/doc
local p = {};
function p.renderLine( frame )
local args = frame:getParent().args;
if args[ 'title' ] and args[ 'title' ] ~= '' then
local style = ( args[ 'style_labels' ] or '' ) .. ( args[ 'style_label' ] or '' );
local class = ( args[ 'ะบะปะฐัั' ] or '' );
return '\n<tr>\n<th colspan="2" class="infobox-header ' .. class .. '" style="' .. style .. '">' ..
args[ 'title' ] ..
'</th>\n</tr>';
end
local text = args[ 'text' ] or '';
if args[ 'wikidata' ] and args[ 'wikidata' ] ~= '' then
text = frame:expandTemplate{ title = 'Wikidata', args = {
args[ 'wikidata' ],
text,
from = args[ 'from' ] or ''
} };
end
if text ~= '' then
local label = args[ 'label' ] or '';
local class = args[ 'class' ] or '';
if class ~= 'noplainlist' then
class = class .. ' plainlist';
end
if class ~= '' then
class = ' class="' .. class .. '"';
end
local style = ( args[ 'textsstyle' ] or '' ) .. ( args[ 'textstyle' ] or '' );
if label == '' then
style = 'text-align:center;' .. style;
end
if style ~= '' then
style = ' style="' .. style .. '"';
end
if label ~= '' then
local labelClass = args[ 'class_label' ] or '';
if labelClass ~= 'noplainlist' then
labelClass = labelClass .. ' plainlist';
end
if labelClass ~= '' then
labelClass = ' class="' .. labelClass .. '"';
end
local labelStyle = ( args[ 'style_labels' ] or '' ) .. ( args[ 'style_label' ] or '' );
if labelStyle ~= '' then
labelStyle = ' style="' .. labelStyle .. '"';
end
return '\n<tr>\n<th' .. labelClass .. labelStyle .. '>' .. label .. '</th>' ..
'\n<td' .. class .. style .. '>\n' .. text .. '</td>\n</tr>';
end
return '\n<tr>\n<td colspan="2"' .. class .. style .. '>\n' .. text .. '</td>\n</tr>';
end
return '';
end
return p;