Modul:InfoboxNeue/doc
Aus Star Citizen Wiki
Weitere Optionen
Dies ist die Dokumentationsseite für Modul:InfoboxNeue
| Function list |
|---|
| L 23 — t L 39 — restoreUnderscore L 45 — formatNumber L 63 — getDetailsHTML L 87 — methodtable.tableToCommaList L 100 — methodtable.formatRange L 128 — methodtable.addUnitIfExists L 140 — methodtable.renderMessage L 160 — methodtable.renderImage L 207 — methodtable.renderIndicator L 254 — methodtable.renderHeader L 301 — methodtable.renderSection L 350 — methodtable.renderLinkButton L 387 — methodtable.renderFooter L 394 — isNonEmpty L 450 — methodtable.renderFooterButton L 463 — renderItemIconElement L 475 — renderItemLinkElements L 494 — renderItemTextElements L 512 — methodtable.renderItem L 583 — methodtable.renderInfobox L 593 — renderContent L 600 — renderSnippet L 641 — methodtable.showDescIfDiff L 650 — InfoboxNeue.showDescIfDiff L 658 — InfoboxNeue.new L 692 — InfoboxNeue.fromArgs |
Dieses Modul wird von Lua-Modulen genutzt, um Infoboxen zu bauen. Für neuere Lua-Module sollte Modul:InfoboxLua verwendet werden.
Vorlagen-Benutzer rufen es über Vorlage:Infobox auf (
Zusammenfassung:InfoboxNeue/doc
).
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 | erforderlich |
class |
HTML-Klassen, die dem Indikator hinzugefügt werden sollen | string | optional |
color |
Farbklasse des Indikators (infobox__indicator--<color>) |
string | optional |
nopadding |
Innenabstand des Indikators entfernen | boolean | optional |
tooltip |
Tooltip-Angabe, gerendert über Modul:FloatingUI | string | optional |
infobox:renderIndicator( {
data = 'Indicator',
class = 'infobox__indicator--nopadding',
tooltip = '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
Neben der vereinfachten Form renderItem( label, data ) akzeptiert renderItem eine Tabelle.
Die Textfelder label, data und desc akzeptieren auch Tabellen; diese werden kommagetrennt verkettet.
| Parameter | Beschreibung | Typ | Status |
|---|---|---|---|
data |
Daten des Items; Tabellen werden kommagetrennt verkettet | table | erforderlich |
label |
Label des Items; Tabellen werden kommagetrennt verkettet | table | optional |
desc |
Beschreibung des Items; Tabellen werden kommagetrennt verkettet | table | optional |
row |
Item in einer Zeile darstellen | boolean | optional |
spacebetween |
Abstand zwischen den Elementen des Items | boolean | optional |
colspan |
Anzahl der Spalten, über die sich das Item erstreckt | int | optional |
class |
HTML-Klassen, die dem Item hinzugefügt werden | string | optional |
icon |
Rendert ein Icon-Element vor dem Text | string | optional |
page |
Interner Link; macht das Item zu einem Button-Item mit Pfeil | string | optional |
link |
Externer Link; macht das Item zu einem Button-Item mit Pfeil | string | optional |
tooltip |
Tooltip, gerendert über Modul:FloatingUI | string | optional |
range |
Zeichnet eine Bereichsleiste, z. B. für Schadenswerte: { start = 0, end = 60 } |
table | optional |
infobox:renderItem( {
label = 'Item label',
data = 'Item data'
} )
-- Button-Item mit Icon und Tooltip
infobox:renderItem( {
label = 'Hersteller',
data = 'Anvil Aerospace',
page = 'Anvil Aerospace',
icon = 'menu',
tooltip = 'Herstellerseite öffnen'
} )
Sektion
Dies wird verwendet, um Elemente in einen Abschnitt einzuschließen.
| Parameter | Beschreibung | Typ | Status |
|---|---|---|---|
content |
Inhalt der Sektion | string | erforderlich |
title |
Titel der Sektion | string | optional |
subtitle |
Untertitel der Sektion | string | optional |
col |
Spaltenzahl der Sektion | int | optional |
class |
HTML-Klassen, die der Sektion hinzugefügt werden | string | optional |
contentClass |
HTML-Klassen, die dem Sektionsinhalt hinzugefügt werden | string | optional |
infobox:renderSection( {
title = 'Section title',
content = sectionTable,
col = 3
} )
Layout
Zeile
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 = table.concat( sectionTable )
} )
Liste
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.',
} ),
infobox:renderItem( {
data = 'Pancetta is great',
desc = 'Kevin pig fatback, alcatra pancetta sirloin venison tri-tip shankle kielbasa meatloaf.',
} ),
infobox:renderItem( {
data = 'Prosciutto is wonderful',
desc = 'Venison chicken meatloaf, ground round swine short ribs shankle short loin tenderloaf jerky capicola.',
} )
}
-- Create section with items
infobox:renderSection( {
title = 'List layout',
subtitle = 'This is an example of the list layout.',
content = table.concat( sectionTable )
} )
Raster
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 = 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
} )


