Jump to content

Template:CompanyCargo: Difference between revisions

From Consumer Rights Wiki
added "short description" for browser extension
Tag: 2017 source edit
Remove more whitespace
 
(34 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
{{Important|Testing cargo installation}}
{{Documentation}}
This is the "Company" template used with cargo and the wiki extension.
{{#cargo_declare:_table=Company
 
| Description  = String
'''Short description:''' This appears in the browser extension when someone visits this company's website. Limit to 140 characters. Be concise and clear.
| Founded      = Date
 
| Industry      = List (,) of String
{{#cargo_declare:_table=Companies
| Logo          = File
|Country=String
| ParentCompany = Page
|ShortDescription=String
| Type          = String
| Website      = List (,) of URL
}}
}}
<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": {
"Founded": {
"label": "Founded",
"description": "Date when the company was founded",
"type": "date",
"example": "2013 OR 2013-11 OR 2013-11-23 (YYYY-MM-DD where month and day are optional)",
"required": false
},
"Industry": {
"label": "Industry",
"description": "Industries that this company is part of",
"example": "Electronics,GPUs",
"type": "string"
},
"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, or other",
"example": "Public",
"type": "string",
"suggestedvalues": [
"Public",
"Private",
                "Government",
                "Non-Profit"
]
},
"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.apple.com/",
"type": "url"
},
"Description": {
"label": "Description",
"description": "Description of a company in 150 characters or less",
"type": "string"
}
},
"format": "block"
}
</templatedata>
</noinclude>
</noinclude>
<includeonly>
 
{{#cargo_store:_table=Companies
<includeonly>{{#cargo_store:_table=Company
|ShortDescription={{{short_description|}}}
| Founded      = {{{Founded|}}}
}}
| Industry      = {{{Industry|}}}
{|
| Logo          = {{{Logo|}}}
! Country of origin
| ParentCompany = {{{ParentCompany|}}}
| {{{Country|}}}
| Type          = {{{Type|}}}
|-
| Website      = {{{Website|}}}
! Short description (for browser extension)
| Description  = {{{Description|}}}
| {{{short_description|}}}
}}<div class="infobox">
|-
  <div style="display: flex; gap: 8px; flex-direction: column">
! Incidents
    <div class="infobox-title">{{PAGENAME}}</div>
| {{#cargo_query:tables=Incidents|where=Companies HOLDS '{{PAGENAME}}'}}
    <div class="infobox-image">[[File:{{{Logo|QuestionMark.svg}}}|200px]]</div>
|}
    <table class="infobox-table">
      <tr>
        <th colspan="2" class="infobox-table-caption">Basic information</th>
      </tr>
      <tr>
        <th>{{nowrap|Founded}}</th>
        <td>{{{Founded|}}}</td>
      </tr>
      <tr>
        <th>{{nowrap|Legal Structure}}</th>
        <td>{{{Type|}}}</td>
      </tr>
      <tr>
        <th>{{nowrap|Industry}}</th>
        <td>{{{Industry|}}}</td>
      </tr>
      <tr>
        <th>{{nowrap|Official website}}</th>
        <td>{{{Website|}}}</td>
      </tr>
    </table>
  </div>
</div>
</includeonly>
</includeonly>

Latest revision as of 21:40, 18 July 2025

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.

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
FoundedFounded

Date when the company was founded

Example
2013 OR 2013-11 OR 2013-11-23 (YYYY-MM-DD where month and day are optional)
Dateoptional
IndustryIndustry

Industries that this company is part of

Example
Electronics,GPUs
Stringoptional
LogoLogo

Image file of the company's logo

Example
Apple.png
Fileoptional
Parent CompanyParentCompany

Parent company to the company

Example
John Deere
Page nameoptional
Legal structureType

Refers to if a company is public, private, non-profit, part of the government, or other

Suggested values
Public Private Government Non-Profit
Example
Public
Stringoptional
Official WebsiteWebsite

Links to a company website - only include a website if it represents a separate top level domain (TLD) or regional variation

Example
https://www.apple.com/
URLoptional
DescriptionDescription

Description of a company in 150 characters or less

Stringoptional