More actions
Created blank page |
No edit summary |
||
| Line 1: | Line 1: | ||
{{Documentation|scwShared=true}} | |||
This module is used by [[SC:Lua|Lua]] modules to build infobox. | |||
== Components == | |||
{{#invoke:InfoboxNeue/example|makeComponentsExample}} | |||
=== Image === | |||
<syntaxhighlight lang="lua"> | |||
infobox:renderImage( 'Pico at New Babbage 1 1.jpg' ) | |||
</syntaxhighlight> | |||
=== Indicator === | |||
{| class="wikitable" | |||
! Parameter !! Description !! Type !! Status | |||
|- | |||
| <code>data</code> || Data of the indicator || string || '''required''' | |||
|- | |||
| <code>desc</code> || Description of the indicator || string || optional | |||
|- | |||
| <code>class</code> || HTML classes to be added to the indicator || string || optional | |||
|} | |||
<syntaxhighlight lang="lua"> | |||
infobox:renderIndicator( { | |||
data = 'Indicator' | |||
} ) | |||
</syntaxhighlight> | |||
=== Header === | |||
{| class="wikitable" | |||
! Parameter !! Description !! Type !! Status | |||
|- | |||
| <code>title</code> || Title of the infobox || string || '''required''' | |||
|- | |||
| <code>subtitle</code> || Subtitle of the infobox || string || optional | |||
|} | |||
<syntaxhighlight lang="lua"> | |||
infobox:renderHeader( { | |||
title = 'Title', | |||
subtitle = 'Subtitle' | |||
} ) | |||
</syntaxhighlight> | |||
=== Message === | |||
This is a shortcut way to create a message wrapped in a section. | |||
{| class="wikitable" | |||
! Parameter !! Description !! Type !! Status | |||
|- | |||
| <code>title</code> || Title of the message || string || '''required''' | |||
|- | |||
| <code>desc</code> || Description of the message || string || optional | |||
|} | |||
<syntaxhighlight lang="lua"> | |||
infobox:renderMessage( { | |||
title = 'Message title', | |||
desc = 'Message description' | |||
} ) | |||
</syntaxhighlight> | |||
=== Item === | |||
{| class="wikitable" | |||
! Parameter !! Description !! Type !! Status | |||
|- | |||
| <code>data</code> || Data of the item || string || '''required''' | |||
|- | |||
| <code>label</code> || Label of the item || string || optional | |||
|- | |||
| <code>desc</code> || Description of the item || string || optional | |||
|- | |||
| <code>row</code> || Whether to display the item in a row || boolean || optional | |||
|- | |||
| <code>spacebetween</code> || Whether to put space between elements in the item || boolean || optional | |||
|- | |||
| <code>colspan</code> || Number of columns that the item spans || int || optional | |||
|} | |||
<syntaxhighlight lang="lua"> | |||
infobox:renderItem( { | |||
label = 'Item label', | |||
data = 'Item data' | |||
} ) | |||
</syntaxhighlight> | |||
=== Section === | |||
This is used to wrap items into a section. | |||
{| class="wikitable" | |||
! Parameter !! Description !! Type !! Status | |||
|- | |||
| <code>content</code> || Content of the section || string || '''required''' | |||
|- | |||
| <code>title</code> || Title of the section || string || optional | |||
|- | |||
| <code>subtitle</code> || Subtitle of the section || string || optional | |||
|- | |||
| <code>col</code> || Number of columns in the section || int || optional | |||
|- | |||
| <code>class</code> || HTML classes to be added to the section || string || optional | |||
|} | |||
<syntaxhighlight lang="lua"> | |||
infobox:renderSection( { | |||
title = 'Section title', | |||
content = table.concat( sectionTable ), | |||
col = 3 | |||
} ) | |||
</syntaxhighlight> | |||
== Layout == | |||
=== Row === | |||
{{#invoke:InfoboxNeue/example|makeRowSection}} | |||
<syntaxhighlight lang="lua"> | |||
-- Create items | |||
sectionTable = { | |||
infobox:renderItem( { | |||
label = 'Bacon', | |||
data = 'Good', | |||
row = true, | |||
spacebetween = true | |||
} ), | |||
infobox:renderItem( { | |||
label = 'Pancetta', | |||
data = 'Great', | |||
row = true, | |||
spacebetween = true | |||
} ), | |||
infobox:renderItem( { | |||
label = 'Prosciutto', | |||
data = 'Wonderful', | |||
row = true, | |||
spacebetween = true | |||
} ) | |||
} | |||
-- Create section with items | |||
infobox:renderSection( { | |||
title = 'Row layout', | |||
subtitle = 'This is an example of the row layout.', | |||
content = table.concat( sectionTable ) | |||
} ) | |||
</syntaxhighlight> | |||
=== List === | |||
{{#invoke:InfoboxNeue/example|makeListSection}} | |||
<syntaxhighlight lang="lua"> | |||
-- Create items | |||
sectionTable = { | |||
infobox:renderItem( { | |||
data = 'Bacon is good', | |||
desc = 'Bacon ipsum dolor amet burgdoggen boudin spare ribs pork pork chop drumstick beef. Jowl turkey pork, kevin shankle shank shoulder. ', | |||
} ), | |||
infobox:renderItem( { | |||
data = 'Pancetta is great', | |||
desc = 'Kevin pig fatback, alcatra pancetta sirloin venison tri-tip shankle kielbasa meatloaf spare ribs beef. Corned beef salami kielbasa tenderloin swine spare ribs andouille.', | |||
} ), | |||
infobox:renderItem( { | |||
data = 'Prosciutto is wonderful', | |||
desc = 'Venison chicken meatloaf, ground round swine short ribs shankle short loin tenderloin jerky capicola. Prosciutto venison sirloin beef brisket pancetta.', | |||
} ) | |||
} | |||
-- Create section with items | |||
infobox:renderSection( { | |||
title = 'List layout', | |||
subtitle = 'This is an example of the list layout.', | |||
content = table.concat( sectionTable ) | |||
} ) | |||
</syntaxhighlight> | |||
=== Grid === | |||
{{#invoke:InfoboxNeue/example|makeGridSection}} | |||
<syntaxhighlight lang="lua"> | |||
-- Create items | |||
sectionTable = { | |||
infobox:renderItem( { | |||
label = 'Bacon', | |||
data = 'Good' | |||
} ), | |||
infobox:renderItem( { | |||
label = 'Pancetta', | |||
data = 'Great' | |||
} ), | |||
infobox:renderItem( { | |||
label = 'Prosciutto', | |||
data = 'Wonderful' | |||
} ), | |||
infobox:renderItem( { | |||
label = 'Capicola', | |||
data = 'Delightful' | |||
} ) | |||
} | |||
-- Create section with items | |||
infobox:renderSection( { | |||
title = '2 col grid layout', | |||
subtitle = 'This is an example of the two column grid layout.', | |||
content = table.concat( sectionTable ), | |||
col = 2 | |||
} ) | |||
infobox:renderSection( { | |||
title = '3 col grid layout', | |||
subtitle = 'This is an example of the three column grid layout.', | |||
content = table.concat( sectionTable ), | |||
col = 3 | |||
} ) | |||
infobox:renderSection( { | |||
title = '4 col grid layout', | |||
subtitle = 'This is an example of the four column grid layout.', | |||
content = table.concat( sectionTable ), | |||
col = 4 | |||
} ) | |||
</syntaxhighlight> | |||
Revision as of 01:16, 13 March 2025
Lua error in Module:DependencyList at line 575: attempt to index field 'smw' (a nil value).
This module is used by Lua modules to build infobox.
Components
Script error: No such module "InfoboxNeue/example".
Image
infobox:renderImage( 'Pico at New Babbage 1 1.jpg' )
Indicator
| Parameter | Description | Type | Status |
|---|---|---|---|
data |
Data of the indicator | string | required |
desc |
Description of the indicator | string | optional |
class |
HTML classes to be added to the indicator | string | optional |
infobox:renderIndicator( {
data = 'Indicator'
} )
Header
| Parameter | Description | Type | Status |
|---|---|---|---|
title |
Title of the infobox | string | required |
subtitle |
Subtitle of the infobox | string | optional |
infobox:renderHeader( {
title = 'Title',
subtitle = 'Subtitle'
} )
Message
This is a shortcut way to create a message wrapped in a section.
| Parameter | Description | Type | Status |
|---|---|---|---|
title |
Title of the message | string | required |
desc |
Description of the message | string | optional |
infobox:renderMessage( {
title = 'Message title',
desc = 'Message description'
} )
Item
| Parameter | Description | Type | Status |
|---|---|---|---|
data |
Data of the item | string | required |
label |
Label of the item | string | optional |
desc |
Description of the item | string | optional |
row |
Whether to display the item in a row | boolean | optional |
spacebetween |
Whether to put space between elements in the item | boolean | optional |
colspan |
Number of columns that the item spans | int | optional |
infobox:renderItem( {
label = 'Item label',
data = 'Item data'
} )
Section
This is used to wrap items into a section.
| Parameter | Description | Type | Status |
|---|---|---|---|
content |
Content of the section | string | required |
title |
Title of the section | string | optional |
subtitle |
Subtitle of the section | string | optional |
col |
Number of columns in the section | int | optional |
class |
HTML classes to be added to the section | string | optional |
infobox:renderSection( {
title = 'Section title',
content = table.concat( sectionTable ),
col = 3
} )
Layout
Row
Script error: No such module "InfoboxNeue/example".
-- Create items
sectionTable = {
infobox:renderItem( {
label = 'Bacon',
data = 'Good',
row = true,
spacebetween = true
} ),
infobox:renderItem( {
label = 'Pancetta',
data = 'Great',
row = true,
spacebetween = true
} ),
infobox:renderItem( {
label = 'Prosciutto',
data = 'Wonderful',
row = true,
spacebetween = true
} )
}
-- Create section with items
infobox:renderSection( {
title = 'Row layout',
subtitle = 'This is an example of the row layout.',
content = table.concat( sectionTable )
} )
List
Script error: No such module "InfoboxNeue/example".
-- Create items
sectionTable = {
infobox:renderItem( {
data = 'Bacon is good',
desc = 'Bacon ipsum dolor amet burgdoggen boudin spare ribs pork pork chop drumstick beef. Jowl turkey pork, kevin shankle shank shoulder. ',
} ),
infobox:renderItem( {
data = 'Pancetta is great',
desc = 'Kevin pig fatback, alcatra pancetta sirloin venison tri-tip shankle kielbasa meatloaf spare ribs beef. Corned beef salami kielbasa tenderloin swine spare ribs andouille.',
} ),
infobox:renderItem( {
data = 'Prosciutto is wonderful',
desc = 'Venison chicken meatloaf, ground round swine short ribs shankle short loin tenderloin jerky capicola. Prosciutto venison sirloin beef brisket pancetta.',
} )
}
-- Create section with items
infobox:renderSection( {
title = 'List layout',
subtitle = 'This is an example of the list layout.',
content = table.concat( sectionTable )
} )
Grid
Script error: No such module "InfoboxNeue/example".
-- Create items
sectionTable = {
infobox:renderItem( {
label = 'Bacon',
data = 'Good'
} ),
infobox:renderItem( {
label = 'Pancetta',
data = 'Great'
} ),
infobox:renderItem( {
label = 'Prosciutto',
data = 'Wonderful'
} ),
infobox:renderItem( {
label = 'Capicola',
data = 'Delightful'
} )
}
-- Create section with items
infobox:renderSection( {
title = '2 col grid layout',
subtitle = 'This is an example of the two column grid layout.',
content = table.concat( sectionTable ),
col = 2
} )
infobox:renderSection( {
title = '3 col grid layout',
subtitle = 'This is an example of the three column grid layout.',
content = table.concat( sectionTable ),
col = 3
} )
infobox:renderSection( {
title = '4 col grid layout',
subtitle = 'This is an example of the four column grid layout.',
content = table.concat( sectionTable ),
col = 4
} )