Jump to content

Template:ProductCargo: Difference between revisions

From Consumer Rights Wiki
Schang1146 (talk | contribs)
Add template parameters
+really good docs for visualeditor ngl
 
(14 intermediate revisions by one other user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
{{Important|This is a work in progress}}
This is the "Product" template used with Cargo and the Wiki extension.
This is the "Product" template used with Cargo and the Wiki extension.


; Fields available:
; Fields available:
: '''Company:''' (Mandatory) Related company pages
: '''ArticleType''' (Optional) Indicates whether or not the incident is related to a "Product" or "Service"
: '''Category:''' (Optional) Categories that the product could fall under (e.g. Laptop, Desktop, Server, etc.)
: '''Company:''' (Optional) Related company pages
: '''Description:''' (Optional) Description of the incident in 150 characters or less
: '''InProduction:''' (Optional) Whether or not the product is still being produced
: '''Logo:''' (Optional) Image file of the product's logo
: '''ProductLine:''' (Optional) Related product line pages
: '''ProductLine:''' (Optional) Related product line pages
: '''Category:''' (Optional) Categories that the product could fall under (e.g. Laptop, Desktop, Server, etc.)
: '''ReleaseYear:''' (Optional) Year that the product was released
: '''ArticleType''' (Mandatory) Indicates whether or not the incident is related to a "Product" or "Service"
: '''Website:''' (Optional) Links to a product's website - only include a website if it represents a separate top level domain (TLD) or regional variation
: '''Website:''' (Optional) Links to a product's website - only include a website if it represents a separate top level domain (TLD) or regional variation
: '''Logo:''' (Optional) Image file of the product's logo
: '''Description:''' (Mandatory) Description of the incident in 150 characters or less


{{#template_params:ArticleType (label=Article Type)
                  |Category (label=Category)
                  |Company (label=Company)
                  |Description (label=Description)
                  |InProduction (label=In Production)
                  |Logo (label=Logo)
                  |ProductLine (label=Product Line)
                  |ReleaseYear (label=Release Year)
                  |Website (label=Website)
}}
{{#cargo_declare:_table=Product
{{#cargo_declare:_table=Product
| Company        = List (,) of Page (mandatory)
| ArticleType    = String (allowed values=Product,Service)
| Category      = List (,) of String
| Company        = List (,) of Page
| Description    = String
| InProduction  = Boolean
| Logo          = File
| ProductLine    = List (,) of Page
| ProductLine    = List (,) of Page
| Category      = List (,) of String
| ReleaseYear   = Date
| ArticleType   = String (allowed values=Product,Service; mandatory)
| Website        = List (,) of URL
| Website        = List (,) of URL
| Logo          = File
| Description    = String (mandatory)
}}
}}
</noinclude>
</noinclude>
<includeonly>
<includeonly>{{#cargo_store:_table=Product
{{#cargo_store:_table=Product
| ArticleType    = {{{ArticleType|}}}
| Company        = {{{Company}}}
| Category      = {{{Category|}}}
| ProductLine   = {{{ProductLine}}}
| Company        = {{{Company|}}}
| Category      = {{{Category}}}
| Description   = {{{Description|}}}
| ArticleType   = {{{ArticleType}}}
| InProduction  = {{{InProduction|}}}
| Website        = {{{Website}}}
| Logo          = {{{Logo|}}}
| Logo          = {{{Logo}}}
| ProductLine    = {{{ProductLine|}}}
| Description   = {{{Description}}}
| ReleaseYear   = {{{ReleaseYear|}}}
}}
| Website        = {{{Website|}}}
</includeonly>
}}<div class="infobox">
    <div style="display: flex; gap: 8px; flex-direction: column">
        <div class="infobox-title">{{PAGENAME}}</div>
        <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|Release Year}}</th>
                <td>{{{ReleaseYear|}}}</td>
            </tr>
 
            <tr>
                <th>{{nowrap|Product Type}}</th>
                <td>{{{Category|}}}</td>
            </tr>
 
            <tr>
                <th>{{nowrap|In Production}}</th>
                <td>{{{InProduction|}}}</td>
            </tr>
 
            <tr>
                <th>{{nowrap|Official Website}}</th>
                <td>{{#explode:{{{Website|}}}|,|0}}</td>
            </tr>
        </table>
    </div>
</div></includeonly>
<noinclude>
<templatedata>
{
"params": {
"ArticleType": {
"label": "Article type",
"description": "The type of article it is.",
"suggested": true
},
"Category": {},
"Company": {
"description": "The company that owns the product.",
"suggested": true
},
"Description": {
"description": "Describe the product here.",
"suggested": true
},
"InProduction": {
"label": "In production",
"description": "If it is in production, type ‘yes’. If it isn’t, type ‘no’.",
"example": "Yes",
"type": "boolean",
"suggested": true
},
"Logo": {
"description": "The logo. You can add already existing logos here.",
"type": "wiki-file-name",
"suggested": true
},
"ProductLine": {
"label": "Product line",
"description": "The line of products it is in.",
"example": "Amazon Echo",
"suggested": true
},
"ReleaseYear": {
"label": "Release year",
"description": "The year that this product was released.",
"suggested": true
},
"Website": {
"description": "The website for the product.",
"type": "url",
"suggested": true
}
},
"paramOrder": [
"ArticleType",
"Category",
"Company",
"Description",
"InProduction",
"Logo",
"ProductLine",
"ReleaseYear",
"Website"
]
}
</templatedata>
</noinclude>

Latest revision as of 16:14, 5 November 2025

This is the "Product" template used with Cargo and the Wiki extension.

Fields available
ArticleType (Optional) Indicates whether or not the incident is related to a "Product" or "Service"
Category: (Optional) Categories that the product could fall under (e.g. Laptop, Desktop, Server, etc.)
Company: (Optional) Related company pages
Description: (Optional) Description of the incident in 150 characters or less
InProduction: (Optional) Whether or not the product is still being produced
Logo: (Optional) Image file of the product's logo
ProductLine: (Optional) Related product line pages
ReleaseYear: (Optional) Year that the product was released
Website: (Optional) Links to a product's website - only include a website if it represents a separate top level domain (TLD) or regional variation

This is the "ProductCargo" template.

It should be called in the following format:

{{ProductCargo
|ArticleType=
|Category=
|Company=
|Description=
|InProduction=
|Logo=
|ProductLine=
|ReleaseYear=
|Website=
}}

Edit the page to see the template text.

This template defines the table "Product". View table.


No description.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Article typeArticleType

The type of article it is.

Unknownsuggested
CategoryCategory

no description

Unknownoptional
CompanyCompany

The company that owns the product.

Unknownsuggested
DescriptionDescription

Describe the product here.

Unknownsuggested
In productionInProduction

If it is in production, type ‘yes’. If it isn’t, type ‘no’.

Example
Yes
Booleansuggested
LogoLogo

The logo. You can add already existing logos here.

Filesuggested
Product lineProductLine

The line of products it is in.

Example
Amazon Echo
Unknownsuggested
Release yearReleaseYear

The year that this product was released.

Unknownsuggested
WebsiteWebsite

The website for the product.

URLsuggested