Jump to content

Template:CompanyCargo: Difference between revisions

From Consumer Rights Wiki
Schang1146 (talk | contribs)
No edit summary
Schang1146 (talk | contribs)
Automatically add category if Website is missing
 
(15 intermediate revisions by 2 users not shown)
Line 7: Line 7:
| Logo          = File
| Logo          = File
| ParentCompany = Page
| ParentCompany = Page
| Type          = String (allowed values=Public,Private,Government,Non-Profit,Other)
| CompanyAlias  = List (,) of String
| Type          = String
| Website      = List (,) of URL
| Website      = List (,) of URL
}}
}}
Line 41: Line 42:
"Type": {
"Type": {
"label": "Legal structure",
"label": "Legal structure",
"description": "Refers to if a company is public, private, non-profit, part of the government, or other",
"description": "Refers to if a company is public, private, non-profit, part of the government, a subsidiary, or other",
"example": "Public",
"example": "Public",
"type": "string",
"type": "string",
Line 49: Line 50:
                 "Government",
                 "Government",
                 "Non-Profit",
                 "Non-Profit",
                 "Other"
                 "Other",
                "Subsidiary"
]
]
},
},
Line 55: Line 57:
"label": "Official 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",
"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",
"example": "https://www.deere.com/,https://www.deere.ca/",
"type": "url"
"type": "url"
},
},
Line 61: Line 63:
"label": "Description",
"label": "Description",
"description": "Description of a company in 150 characters or less",
"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"
"type": "string"
}
}
Line 68: Line 76:
</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|}}}
}}
}}<!--
<div class="infobox">
// conditional categories if fields are missing
  <div style="display: flex; gap: 8px; flex-direction: column">
-->{{#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 98: Line 109:
         <th>{{nowrap|Industry}}</th>
         <th>{{nowrap|Industry}}</th>
         <td>{{{Industry|}}}</td>
         <td>{{{Industry|}}}</td>
      </tr>
      <tr>
        <th>{{nowrap|Also known as}}</th>
        <td>{{{CompanyAlias|}}}</td>
       </tr>
       </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.

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, a subsidiary, or other

Suggested values
Public Private Government Non-Profit Other Subsidiary
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.deere.com/,https://www.deere.ca/
URLoptional
DescriptionDescription

Description of a company in 150 characters or less

Stringoptional
Company AliasCompanyAlias

Alternative names or abbreviations for the company

Example
AAPL,Apple Inc.
Stringoptional