Dies ist die Dokumentationsseite für Modul:InfoboxNeue
Dies ist die Dokumentationsseite für 'Modul:InfoboxNeue'.
Es enthält Nutzungsinformationen, Kategorien und andere Inhalte, die nicht Teil der Original Modul-Seite sind.
Function list |
---|
L 23 — translate L 39 — restoreUnderscore L 45 — formatNumber L 67 — methodtable.tableToCommaList L 80 — methodtable.formatRange L 108 — methodtable.addUnitIfExists L 121 — methodtable.renderMessage L 142 — methodtable.renderImage L 189 — methodtable.renderIndicator L 221 — methodtable.renderHeader L 269 — methodtable.renderSection L 318 — methodtable.renderLinkButton L 355 — methodtable.renderFooter L 362 — isNonEmpty L 418 — methodtable.renderFooterButton L 433 — methodtable.renderItem L 511 — methodtable.renderInfobox L 521 — renderSnippet L 558 — methodtable.showDescIfDiff L 568 — InfoboxNeue.showDescIfDiff L 577 — InfoboxNeue.new L 609 — InfoboxNeue.fromArgs |
Instantiation
local infobox = require( 'Module:InfoboxNeue' ):new()
-- Mit Konfiguration
local infobox = require( 'Module:InfoboxNeue' ):new( {
-- Flag to discard empty rows
removeEmpty = false,
-- Optional string which is valued as empty
emptyString = nil,
-- Display a placeholder image if addImage does not find an image
displayPlaceholder = true,
-- Placeholder Image
placeholderImage = 'Platzhalter.webp',
} )
Konfiguration
Parameter | Beschreibung | Typ |
---|---|---|
removeEmpty |
Setze dies auf true um leere Items zu entfernen |
boolean |
emptyString |
Wenn removeEmpty wahr ist, wird das data Feld aus renderItem gegen diesen Wert geprüft |
string |
displayPlaceholder |
Wenn renderImage ohne Bild aufgerufen wird, wird ein Platzhalter angezeigt. |
boolean |
placeholderImage |
Link zu einer lokalen Platzhalterdatei | string |
Components
Zusammenfassung:
InfoboxNeue/doc
Bild
infobox:renderImage( 'Galactapedia_Pico_the_Penguin.jpg' )
Indikator
Parameter | Beschreibung | Typ | Status |
---|---|---|---|
data |
Daten des Indikators | string | required |
desc |
Beschreibung des Indikators | string | optional |
class |
HTML-Klassen, die dem Indikator hinzugefügt werden sollen | string | optional |
infobox:renderIndicator( {
data = 'Indicator',
desc = 'Indicator message',
} )
Header
Parameter | Beschreibung | Typ | Status |
---|---|---|---|
title |
Titel der Infobox | string | erforderlich |
subtitle |
Untertitel der Infobox | string | optional |
infobox:renderHeader( {
title = 'Title',
subtitle = 'Subtitle'
} )
-- Or
infobox:renderHeader( 'Title' )
Nachricht
Dies ist eine schnelle Methode, um eine Nachricht zu erstellen, die in einen Abschnitt eingeschlossen ist.
Parameter | Beschreibung | Typ | Status |
---|---|---|---|
title |
Titel der Nachricht | string | erforderlich |
desc |
Beschreibung der Nachricht | string | optional |
infobox:renderMessage( {
title = 'Message title',
desc = 'Message description'
} )
Item
Parameter | Beschreibung | Typ | 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'
} )
Sektion
Dies wird verwendet, um Elemente in einen Abschnitt einzuschließen.
Parameter | Beschreibung | Typ | 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 = sectionTable,
col = 3
} )
Layout
Row
Zusammenfassung:
InfoboxNeue/doc
Row layout
This is an example of the row layout.
Bacon
Good
Pancetta
Great
Prosciutto
Wonderful
-- 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 = sectionTable
} )
List
Zusammenfassung:
InfoboxNeue/doc
List layout
This is an example of the list layout.
Bacon is good
Bacon ipsum dolor amet burgdoggen boudin spare ribs pork pork chop drumstick beef. Jowl turkey pork, kevin shankle shank shoulder.
Pancetta is great
Kevin pig fatback, alcatra pancetta sirloin venison tri-tip shankle kielbasa meatloaf spare ribs beef. Corned beef salami kielbasa tenderloin swine spare ribs andouille.
Prosciutto is wonderful
Venison chicken meatloaf, ground round swine short ribs shankle short loin tenderloin jerky capicola. Prosciutto venison sirloin beef brisket pancetta.
-- 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 = sectionTable
} )
Grid
Zusammenfassung:
InfoboxNeue/doc
2 col grid layout
This is an example of the two column grid layout.
Bacon
Good
Pancetta
Great
Prosciutto
Wonderful
Capicola
Delightful
3 col grid layout
This is an example of the three column grid layout.
Bacon
Good
Pancetta
Great
Prosciutto
Wonderful
Capicola
Delightful
4 col grid layout
This is an example of the four column grid layout.
Bacon
Good
Pancetta
Great
Prosciutto
Wonderful
Capicola
Delightful
-- 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 = sectionTable,
col = 2
} )
infobox:renderSection( {
title = '3 col grid layout',
subtitle = 'This is an example of the three column grid layout.',
content = sectionTable,
col = 3
} )
infobox:renderSection( {
title = '4 col grid layout',
subtitle = 'This is an example of the four column grid layout.',
content = sectionTable,
col = 4
} )
Verwendung
Ausgabe
tostring( infobox )
-- Oder
infobox:renderInfobox()