Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Module documentation[view][edit][history][purge]
This documentation is transcluded from Module:Company/doc. Changes can be proposed in the talk page.
Function list
L 7 — p.infobox

Information

This uses the InfoboxNeue module. for more information, visit Star Citizen.

This defines the Company Infobox used by pages.

Example Implementation

{{Company
|image=SLS logo.png
|owner=Realthebritishgamer
|start_date=November 2023
|location_base=[[SLS Maintenance Yard]]
|primary_locomotives=Unknown
|fleet_size=16
|fleet_age=Unknown
}}

Documentation

Creates an infobox for a company.

Template parameters

This template has custom formatting.

ParameterDescriptionTypeStatus
Fleet Sizefleet_size

The size of a company's fleet. (en)

Example
16
Numberoptional
Ownerowner

The owner of a company. (en)

Example
Realthebritishgamer
Contentoptional
End Dateend_date

The date until a company operated. Defaults to 'present' in infoboxes. (en)

Example
2024
Dateoptional
Primary Locomotivesprimary_locomotives

The locomotives a company uses primarily. Can be a hyperlink if the wiki has a page for the locomotives. (en)

Example
Class 27
Contentoptional
Abbreviationabbreviation

The abbreviation of the name of the article's subject. It should be made of 2-3 letters. (en)

Example
SLS
Contentoptional
Imageimage

The thumbnail or gallery of the article. To just set the thumbnail, set the value to the name of the image (with its extension). To create a gallery, use the following format: ''Title1=Image1.png;Title2=Image2.jpg''. The file prefixes are optional for both formats. (en)

Example
Exterior=Placeholder.png;Interior=Placeholder.png
Contentrequired
Statusstatus

The current status of the article's subject. (en)

Suggested values
removed unknown in_development under_testing not_in_service out_of_service steam_only diesel_only available in_operation in_service public admin_only closed in_use
Example
in_operation
Contentrequired
Start Datestart_date

The date on which a company was founded. (en)

Example
2023
Dateoptional
Base Locationlocation_base

The location of a company's base. (en)

Example
SLS Maintenance Yard
Contentoptional
Company Linkscompany_links

The links of a company. (en)

Example
https://example-company.com/
Contentoptional
Status Descriptionstatus_description

Information about the status. Example: The version in which the feature was added into or removed from the game. (en)

Example
Since [[Update Logs#Version 1|Version 1]]
Contentoptional
Fleet Agefleet_age

The age of a company's fleet. (en)

Example
5
Contentoptional



local getArgs  = require( 'Module:Arguments' ).getArgs
local infobox = require( 'Module:InfoboxNeue' ):new()
local getStatus = require("Module:Status").get

local p = {}

function p.infobox(frame)
    local args = getArgs(frame)

    --Main arguments
    local imgPath = args.image
    local title = args.title or mw.title.getCurrentTitle().text
    local captionTitle = args.caption_title
    local caption = args.caption
    local status = args.status
    local statusDescription = args.status_description

    local owner = args.owner
    local companyLinks = args.company_links
    local startDate = args.start_date
    local endDate = args.end_date
    local locationBase = args.location_base
    local abbreviation = args.abbreviation
    
    local primaryLocomotives = args.primary_locomotives
    local fleetSize = args.fleet_size
    local fleetAge = args.fleet_age

	infobox:renderImageOrGallery(imgPath)

    if status then
        local text, class = getStatus(status)
        infobox:renderIndicator( {
            data = text,
            desc = statusDescription,
            class = class
        } )
    else
    	-- render the caption indicator only if there was no status provided
    	infobox:renderIndicator( {
        	data = captionTitle,
        	desc = caption,
    	} )
	end

	infobox:renderHeader( {
		title = title,
		subtitle = 'Company'
	} )
	
	local dateOfOperation = nil
	if startDate then
		dateOfOperation = startDate .. " - " .. (endDate or "present")
	end

    local informationLabels = {
        infobox:renderItem( {
            label = 'Owner',
            data = owner
        } ),
        infobox:renderItem( {
            label = 'Company Links',
            data = companyLinks
        } ),
        infobox:renderItem( {
            label = 'Date of Operation',
            data = dateOfOperation
        } ),
        infobox:renderItem( {
            label = 'Location Base',
            data = locationBase
        } ),
         infobox:renderItem( {
            label = 'Abbreviation',
            data = abbreviation
        } ),
    }
    infobox:renderSection( {
        content = table.concat(informationLabels),
        col = 2
    } )
    
    local rollingStockLabels = {
        infobox:renderItem( {
            label = 'Primary Locomotives',
            data = primaryLocomotives
        } ),
        infobox:renderItem( {
            label = 'Fleet Size',
            data = fleetSize
        } ),
        infobox:renderItem( {
            label = 'Fleet Age',
            data = fleetAge
        } ),
    }
    infobox:renderSection( {
    	title = "Rolling Stock",
        content = table.concat(rollingStockLabels),
        col = 2
    } )
    
	return infobox:renderInfobox(args)
end


return p
🍪 Yum Yum Yum! Cookies help us better deliver our services. By using our site, you agree to our use of cookies.