No edit summary |
No edit summary |
||
(22 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
function p.main(frame) | function p.main(frame) | ||
local args = frame:getParent().args | local args = frame:getParent().args | ||
local retval = capiunto.create( { | local retval = capiunto.create( { | ||
title = args.title, | title = frame.args.title, | ||
headerStyle = | headerStyle = 'background-color:grey;', | ||
bodyClass = 'brand-page-infobox' | |||
} ) | } ) | ||
:addImage( '[[File:'..args.logo..'| | if args.logo and args.logo ~= '' then | ||
retval:addImage( '[[File:'..args.logo..'|500px]]', '', 'brand-md-logo-div' ) end | |||
:addRow( 'Industry', args. | if args.cover and args.cover ~= '' then | ||
:addRow( 'Owner(s)', args.parent, 'brand-md-parent-div' ) | retval:addImage( '[[File:'..args.cover..'|2000px]]', args.coverCaption, 'brand-md-cover-div' ) end | ||
:addRow( 'Products | if args.industry and args.industry ~= '' then | ||
retval:addRow( 'Industry', '[[:Category:'..args.industry..'|'..args.industry..']][[Category:Brand]]', 'brand-md-industry-div' ) | |||
else | |||
retval:addRow( '<!-- Click on this box, then \'Edit\' to add information about this brand. --> [[Category:Incomplete Brand Pages]]', '', 'brand-unfinished' ) end | |||
if args.parent and args.parent ~= '' then | |||
retval:addRow( 'Owner(s)', args.parent, 'brand-md-parent-div' ) end | |||
if args.brands and args.brands ~= '' then | |||
retval:addRow( 'Sub-Brands', args.brands, 'brand-md-brands-div' ) end | |||
if args.products and args.products ~= '' then | |||
retval:addRow( 'Products', args.products, 'brand-md-products-div' ) end | |||
return retval | return retval | ||
end | end | ||
return p | return p |
Latest revision as of 22:58, 8 February 2024
Documentation for this module may be created at Module:BrandHeader/doc
local capiunto = require 'capiunto'
local p = {}
function p.main(frame)
local args = frame:getParent().args
local retval = capiunto.create( {
title = frame.args.title,
headerStyle = 'background-color:grey;',
bodyClass = 'brand-page-infobox'
} )
if args.logo and args.logo ~= '' then
retval:addImage( '[[File:'..args.logo..'|500px]]', '', 'brand-md-logo-div' ) end
if args.cover and args.cover ~= '' then
retval:addImage( '[[File:'..args.cover..'|2000px]]', args.coverCaption, 'brand-md-cover-div' ) end
if args.industry and args.industry ~= '' then
retval:addRow( 'Industry', '[[:Category:'..args.industry..'|'..args.industry..']][[Category:Brand]]', 'brand-md-industry-div' )
else
retval:addRow( '<!-- Click on this box, then \'Edit\' to add information about this brand. --> [[Category:Incomplete Brand Pages]]', '', 'brand-unfinished' ) end
if args.parent and args.parent ~= '' then
retval:addRow( 'Owner(s)', args.parent, 'brand-md-parent-div' ) end
if args.brands and args.brands ~= '' then
retval:addRow( 'Sub-Brands', args.brands, 'brand-md-brands-div' ) end
if args.products and args.products ~= '' then
retval:addRow( 'Products', args.products, 'brand-md-products-div' ) end
return retval
end
return p