Template:CompanyCargo: Difference between revisions
Schang1146 (talk | contribs) No edit summary |
Schang1146 (talk | contribs) Automatically add category if Website is missing |
||
| (24 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
{{ | {{Documentation}} | ||
}} | |||
{{#cargo_declare:_table=Company | {{#cargo_declare:_table=Company | ||
| Description = String | | Description = String | ||
| Line 26: | Line 7: | ||
| Logo = File | | Logo = File | ||
| ParentCompany = Page | | ParentCompany = Page | ||
| Type = String | | CompanyAlias = List (,) of String | ||
| Type = String | |||
| Website = List (,) of URL | | Website = List (,) of URL | ||
}} | }} | ||
<templatedata> | <templatedata> | ||
{ | { | ||
"description": "The CompanyCargo template is responsible for creating a structured database for companies for the Wiki extension and rendering an infobox off the data.", | |||
"params": { | "params": { | ||
"Founded": { | "Founded": { | ||
| Line 39: | Line 21: | ||
"example": "2013 OR 2013-11 OR 2013-11-23 (YYYY-MM-DD where month and day are optional)", | "example": "2013 OR 2013-11 OR 2013-11-23 (YYYY-MM-DD where month and day are optional)", | ||
"required": false | "required": false | ||
}, | |||
"Industry": {}, | "Industry": { | ||
"Logo": {}, | "label": "Industry", | ||
"ParentCompany": {}, | "description": "Industries that this company is part of", | ||
"Type": {}, | "example": "Electronics,GPUs", | ||
"Website": {}, | "type": "string" | ||
"Description": {} | }, | ||
} | "Logo": { | ||
"label": "Logo", | |||
"description": "Image file of the company's logo", | |||
"example": "Apple.png", | |||
"type": "wiki-file-name" | |||
}, | |||
"ParentCompany": { | |||
"label": "Parent Company", | |||
"description": "Parent company to the company", | |||
"example": "John Deere", | |||
"type": "wiki-page-name" | |||
}, | |||
"Type": { | |||
"label": "Legal structure", | |||
"description": "Refers to if a company is public, private, non-profit, part of the government, a subsidiary, or other", | |||
"example": "Public", | |||
"type": "string", | |||
"suggestedvalues": [ | |||
"Public", | |||
"Private", | |||
"Government", | |||
"Non-Profit", | |||
"Other", | |||
"Subsidiary" | |||
] | |||
}, | |||
"Website": { | |||
"label": "Official Website", | |||
"description": "Links to a company website - only include a website if it represents a separate top level domain (TLD) or regional variation", | |||
"example": "https://www.deere.com/,https://www.deere.ca/", | |||
"type": "url" | |||
}, | |||
"Description": { | |||
"label": "Description", | |||
"description": "Description of a company in 150 characters or less", | |||
"type": "string" | |||
}, | |||
"CompanyAlias": { | |||
"label": "Company Alias", | |||
"description": "Alternative names or abbreviations for the company", | |||
"example": "AAPL,Apple Inc.", | |||
"type": "string" | |||
} | |||
}, | |||
"format": "block" | |||
} | } | ||
</templatedata> | </templatedata> | ||
</noinclude> | </noinclude> | ||
<includeonly> | <includeonly><!-- | ||
{{#cargo_store:_table=Company | -->{{#cargo_store:_table=Company | ||
| Founded = {{{Founded|}}} | | Founded = {{{Founded|}}} | ||
| Industry = {{{Industry|}}} | | Industry = {{{Industry|}}} | ||
| Logo = {{{Logo|}}} | | Logo = {{{Logo|}}} | ||
| ParentCompany = {{{ParentCompany|}}} | | ParentCompany = {{{ParentCompany|}}} | ||
| CompanyAlias = {{{CompanyAlias|}}} | |||
| Type = {{{Type|}}} | | Type = {{{Type|}}} | ||
| Website = {{{Website|}}} | | Website = {{{Website|}}} | ||
| Description = {{{Description|}}} | | Description = {{{Description|}}} | ||
}} | }}<!-- | ||
// conditional categories if fields are missing | |||
<div class="infobox"> | -->{{#if:{{{Website|}}}||[[Category:Articles with Company Cargo missing an entry in the Website field]]}}<!-- | ||
// company infobox element | |||
--><div class="infobox"> | |||
<div style="display: flex; gap: 8px; flex-direction: column"> | |||
<div class="infobox-title">{{PAGENAME}}</div> | <div class="infobox-title">{{PAGENAME}}</div> | ||
<div class="infobox-image">[[File:{{{Logo|QuestionMark.svg}}}|200px]]</div> | <div class="infobox-image">[[File:{{{Logo|QuestionMark.svg}}}|200px]]</div> | ||
| Line 69: | Line 98: | ||
<th colspan="2" class="infobox-table-caption">Basic information</th> | <th colspan="2" class="infobox-table-caption">Basic information</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<th>{{nowrap|Founded}}</th> | <th>{{nowrap|Founded}}</th> | ||
<td>{{{Founded|}}}</td> | <td>{{{Founded|}}}</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<th>{{nowrap|Legal Structure}}</th> | <th>{{nowrap|Legal Structure}}</th> | ||
<td>{{{Type|}}}</td> | <td>{{{Type|}}}</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<th>{{nowrap|Industry}}</th> | <th>{{nowrap|Industry}}</th> | ||
<td>{{{Industry|}}}</td> | <td>{{{Industry|}}}</td> | ||
</tr> | </tr> | ||
<tr> | |||
<th>{{nowrap|Also known as}}</th> | |||
<td>{{{CompanyAlias|}}}</td> | |||
</tr> | |||
<tr> | <tr> | ||
<th>{{nowrap|Official website}}</th> | <th>{{nowrap|Official website}}</th> | ||
<td>{{{Website|}}}</td> | <td>{{#explode:{{{Website|}}}|,|0}}</td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
</div> | </div> | ||
</div> | </div><!-- | ||
</includeonly> | --></includeonly> | ||
Latest revision as of 00:43, 18 March 2026
This template defines the table "Company". View table.
The CompanyCargo template is responsible for creating a structured database for companies for the Wiki extension and rendering an infobox off the data.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Founded | Founded | Date when the company was founded
| Date | optional |
| Industry | Industry | Industries that this company is part of
| String | optional |
| Logo | Logo | Image file of the company's logo
| File | optional |
| Parent Company | ParentCompany | Parent company to the company
| Page name | optional |
| Legal structure | Type | Refers to if a company is public, private, non-profit, part of the government, a subsidiary, or other
| String | optional |
| Official Website | Website | Links to a company website - only include a website if it represents a separate top level domain (TLD) or regional variation
| URL | optional |
| Description | Description | Description of a company in 150 characters or less | String | optional |
| Company Alias | CompanyAlias | Alternative names or abbreviations for the company
| String | optional |