Jump to content

Template:Infobox product/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Added TemplateData
m syntaxhighlight lang="wikitext"
 
(18 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE -->
<!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE -->
{{Lua|Module:Infobox|Module:InfoboxImage|Module:WikidataIB|Module:Check for unknown parameters}}
{{Uses Wikidata|P18|P31|P61|P571|P176|P856}}


== Usage ==
== Usage ==
This template can draw data from Wikidata, assuming it is defined there. Simply use <code><nowiki>{{Infobox product}}</nowiki></code>. You may also set values manually:
{{Generic template demo
{{Parameter names example
| title
| title
| logo
| logo_caption
| logo_alt
| image
| image
| image_size
| image_size
Line 11: Line 17:
| type
| type
| inventor
| inventor
| inception
| launch year
| company
| manufacturer
| available
| available
| current supplier
| current supplier
| last production
| last production
| models
| models
| slogan
| url
| website
| notes
| notes
}}
}}


<syntaxhighlight lang="wikitext">
<pre style="overflow:auto;">
{{Infobox product
{{Infobox product
| title =
| title =
| image =
| logo =
| image_size =
| logo_caption =
| alt =
| logo_alt =
| caption =
| image =
| type =
| image_size =
| inventor =
| alt =
| launch year =
| caption =
| company =
| type =
| available =
| inventor =
| inception =
| manufacturer =
| available =
| current supplier =
| current supplier =
| last production =
| last production =
| models =
| models =
| url =
| slogan =
| notes =
| website =
| notes =
}}
}}
</syntaxhighlight>
</pre>
{{clear}}
{{clear}}


==Example==
== Example ==
{{Infobox product
{{Infobox product
| title = Reason washing machine
| title = Reason washing machine
| image =
| image =
| image_size =
| image_size =
| alt =
| alt =
| caption =
| caption =
| type = [[Washing machine]]
| type = [[Washing machine]]
| inventor = [[Andrew Reason]]
| inventor = [[Andrew Reason]]
| launch year = {{start date|2009}}
| inception = {{start date|2009}}
| company = Reason company
| manufacturer = Reason company
| available = Available
| available = Available
| current supplier = Reason
| current supplier = Reason
| last production =
| last production =
| models = Ultra, Super
| models = Ultra, Super
| url =
| slogan =
| notes =
| website =
| notes =
}}
}}

<pre style="overflow:auto;">
<syntaxhighlight lang="wikitext" style="overflow:auto;">
{{Infobox product
{{Infobox product
| title = Reason washing machine
| title = Reason washing machine
| image =
| image =
| image_size =
| image_size =
| alt =
| alt =
| caption =
| caption =
| type = [[Washing machine]]
| type = [[Washing machine]]
| inventor = [[Andrew Reason]]
| inventor = [[Andrew Reason]]
| launch year = {{start date|2009}}
| inception = {{start date|2009}}
| company = Reason Company
| manufacturer = Reason company
| available = Available
| available = Available
| current supplier = Reason
| current supplier = Reason
| last production =
| last production =
| models = Ultra, Super
| models = Ultra, Super
| url =
| website =
| notes =
| notes =
}}
}}
</syntaxhighlight>
</pre>
{{clear}}
{{clear}}


==Microformats==
== Microformats ==
{{UF-hprod}}
{{UF-hprod}}


==See also==
== See also ==
* {{tl|Infobox brand}}
* {{tl|Infobox brand}}


== TemplateData ==
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
{{TemplateData header}}
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Business infobox templates|Product]]
[[Category:Technology and applied science infobox templates|Product]]
}}</includeonly>
<templatedata>
<templatedata>
{
{
Line 98: Line 108:
"label": "Title",
"label": "Title",
"description": "The title of the product stated in the article or what the article is covering.",
"description": "The title of the product stated in the article or what the article is covering.",
"example": "ex. Reason washing machine",
"example": "Reason washing machine",
"type": "string",
"type": "string",
"autovalue": "",
"autovalue": ""
"required": true
},
},
"image": {
"image": {
"label": "Image",
"label": "Image",
"description": "The image that reveals the product stated. Make sure that it is a valued image, as image that are deleted will not show.",
"description": "The image that reveals the product stated. Make sure that it is a valued image, as image that are deleted will not show.",
"example": "ex. example.jpg",
"example": "example.jpg",
"type": "string"
"type": "wiki-file-name",
"suggested": true
},
},
"image_size": {
"image_size": {
"label": "Image size",
"label": "Image size",
"description": "The size of the image. The default is 250px and must not include \"px\".",
"description": "The size of the image. The default is 250px and must not include \"px\".",
"example": "ex. 275",
"example": "275",
"type": "string",
"type": "number",
"default": "Default: 250px",
"default": "250",
"autovalue": "250"
"autovalue": "250",
"deprecated": true,
"aliases": [
"imagesize",
"image size"
]
},
},
"alt": {
"alt": {
"label": "Image alternative text",
"label": "Image alternative text",
"description": "Alternative text describing the image showing the product for visually impaired readers. ",
"description": "Alternative text describing the image showing the product for visually impaired readers. ",
"example": "ex. An Earth globe, and on the left side is being walked upon by a orange-red fur fox, it's own tail is on fire. ",
"example": "An Earth globe, and on the left side is being walked upon by a orange-red fur fox, its own tail is on fire. ",
"type": "string"
"type": "string",
"autovalue": ""
},
},
"caption": {
"caption": {
"label": "Image caption",
"label": "Image caption",
"description": "The caption describing the image shown on the infobox. Must be concise and short, not excessively detailed.",
"description": "The caption describing the image shown on the infobox. Must be concise and short, not excessively detailed.",
"example": "ex. The sixth-generation iPod Nano.",
"example": "The sixth-generation iPod Nano.",
"type": "string"
"type": "string"
},
},
"type": {
"type": {
"label": "Type of product",
"label": "Type",
"description": "The type of the product stated in the article. Can be verified, but must state the type of product.",
"description": "The type of the product stated in the article. Can be verified, but must state the type of product.",
"example": "ex. Media player",
"example": "Media player",
"type": "string",
"type": "string",
"required": true
"required": true
Line 139: Line 155:
"label": "Inventor",
"label": "Inventor",
"description": "The creator or inventor of the product.",
"description": "The creator or inventor of the product.",
"example": "ex. Reason ",
"example": "Reason ",
"type": "string"
"type": "string",
"suggested": true
},
"launch year": {
"label": "Launch year",
"description": "The launch year of the product.",
"example": "ex. {{start date and age|2012|12|21}}",
"type": "string"
},
"company": {
"label": "Company",
"description": "The company or entity that created this product.",
"example": "ex. Moleskine",
"type": "string"
},
},
"available": {
"available": {
"label": "Date when available",
"label": "Available",
"description": "The date when the product became available.",
"description": "Whether the product is currently available.",
"example": "ex. {{2005|12|25}}",
"example": "Yes",
"type": "string"
"type": "string",
"suggested": true
},
},
"current supplier": {
"current supplier": {
"label": "Current supplier",
"label": "Current supplier",
"description": "The distributor or entity that is the most current supplier of this product.",
"description": "The distributor or entity that is the most current supplier of this product.",
"example": "ex. Amazon.com",
"example": "Amazon.com",
"type": "string"
"type": "string"
},
},
Line 169: Line 175:
"label": "Last production date",
"label": "Last production date",
"description": "The date of the last known or confirmed date that the product stopped selling or discontinued.",
"description": "The date of the last known or confirmed date that the product stopped selling or discontinued.",
"example": "ex. {{start date|2016}}",
"example": "2016",
"type": "string"
"type": "date"
},
},
"models": {
"models": {
"label": "Models",
"label": "Models",
"description": "The models in this product.",
"description": "The models of this product.",
"example": "ex. iriver H100",
"example": "iriver H100",
"type": "string"
"type": "string"
},
},
"url": {
"url": {
"aliases": [
"aliases": [
"Official URL"
"Official URL",
"website"
],
],
"label": "Homepage",
"label": "Website",
"description": "The homepage or official URL for this product. It must be at least archived or running.",
"description": "The homepage or official URL for this product. It must be at least archived or running.",
"example": "ex. [http://www.example.net example.net]",
"example": "{{url|example.net}}",
"type": "string"
"type": "url",
"suggested": true
},
},
"notes": {
"notes": {
"label": "Notes",
"label": "Notes",
"type": "string",
"description": "Additional notes"
},
"inception": {
"label": "Inception",
"description": "The launch date of the product.",
"example": "May 2012",
"type": "date",
"suggested": true
},
"manufacturer": {
"label": "Manufacturer",
"description": "The company or entity that manufactures this product.",
"example": "Moleskine",
"type": "string",
"autovalue": "",
"required": true
},
"qid": {},
"fetchwikidata": {},
"suppressfields": {},
"logo": {
"label": "Logo",
"type": "wiki-file-name"
},
"product_logo": {},
"logo_size": {},
"logo_alt": {
"label": "Logo alt text",
"description": "Alt text for the logo",
"type": "string"
"type": "string"
},
"logo_caption": {
"label": "Logo caption",
"description": "Caption for display under the logo",
"type": "content"
},
"image_upright": {},
"onlysourced": {},
"noicon": {},
"launch year": {},
"company": {},
"slogan": {
"aliases": [
"tagline"
],
"label": "Slogan"
},
"Years produced": {
"description": "The years in which the product was made.",
"example": "2002 to 2012"
}
}
},
},
"description": "An infobox for products. This is a general infobox for products that don't have an infobox for their category, and should be used for general products.",
"description": "An infobox for products. This is a general infobox for products that don't have an infobox for their category, and should be used for general products.",
"format": "block"
"format": "block",
"paramOrder": [
"title",
"image",
"logo",
"image_size",
"alt",
"caption",
"type",
"inventor",
"inception",
"manufacturer",
"available",
"current supplier",
"last production",
"models",
"url",
"notes",
"qid",
"fetchwikidata",
"suppressfields",
"product_logo",
"logo_size",
"logo_alt",
"logo_caption",
"image_upright",
"onlysourced",
"noicon",
"launch year",
"company",
"slogan",
"Years produced"
]
}
}
</templatedata>
</templatedata>

{{Wikidata infoboxes}}

<includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Business infobox templates|Product]]
[[Category:Technology and applied science infobox templates|Product]]
}}</includeonly>

Latest revision as of 18:18, 28 May 2023

Usage

[edit]

This template can draw data from Wikidata, assuming it is defined there. Simply use {{Infobox product}}. You may also set values manually:

{{{title}}}
Type{{{type}}}
Inventor{{{inventor}}}
Inception{{{inception}}}
Manufacturer{{{manufacturer}}}
Available{{{available}}}
Current supplier{{{current supplier}}}
Last production year{{{last production}}}
Models made{{{models}}}
Slogan{{{slogan}}}
Website{{{website}}}
Notes
{{{notes}}}
{{Infobox product
| title            = 
| logo             = 
| logo_caption     = 
| logo_alt         = 
| image            = 
| image_size       = 
| alt              = 
| caption          = 
| type             = 
| inventor         = 
| inception        = 
| manufacturer     = 
| available        = 
| current supplier = 
| last production  = 
| models           = 
| slogan           = 
| website          = 
| notes            = 
}}

Example

[edit]
Reason washing machine
TypeWashing machine
InventorAndrew Reason
Inception2009 (2009)
ManufacturerReason company
AvailableAvailable
Current supplierReason
Models madeUltra, Super
{{Infobox product
| title            = Reason washing machine
| image            = 
| image_size       = 
| alt              = 
| caption          = 
| type             = [[Washing machine]]
| inventor         = [[Andrew Reason]]
| inception        = {{start date|2009}}
| manufacturer     = Reason company
| available        = Available
| current supplier = Reason
| last production  = 
| models           = Ultra, Super
| website          = 
| notes            = 
}}

Microformats

[edit]

The HTML mark-up produced by this template includes an hProduct microformat that makes a product's details readily parsable by computer programs. This aids tasks such as the cataloguing of articles and maintenance of databases. For more information about the use of microformats on Wikipedia, please visit the Microformat WikiProject.

If the product has a URL, use {{URL}} to include it.

Classes used

The HTML classes of this microformat include:

  • brand
  • category
  • description
  • fn
  • hproduct
  • identifier
  • listing
  • photo
  • price
  • review
  • type
  • url
  • value
Please do not rename or remove these classes
nor collapse nested elements which use them.

See also

[edit]

TemplateData

[edit]
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Infobox product in articles based on its TemplateData.

TemplateData for Infobox product

An infobox for products. This is a general infobox for products that don't have an infobox for their category, and should be used for general products.

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Titletitle

The title of the product stated in the article or what the article is covering.

Example
Reason washing machine
Auto value
Stringoptional
Imageimage

The image that reveals the product stated. Make sure that it is a valued image, as image that are deleted will not show.

Example
example.jpg
Filesuggested
Logologo

no description

Fileoptional
Image sizeimage_size imagesize image size

The size of the image. The default is 250px and must not include "px".

Default
250
Example
275
Auto value
250
Numberdeprecated
Image alternative textalt

Alternative text describing the image showing the product for visually impaired readers.

Example
An Earth globe, and on the left side is being walked upon by a orange-red fur fox, its own tail is on fire.
Auto value
Stringoptional
Image captioncaption

The caption describing the image shown on the infobox. Must be concise and short, not excessively detailed.

Example
The sixth-generation iPod Nano.
Stringoptional
Typetype

The type of the product stated in the article. Can be verified, but must state the type of product.

Example
Media player
Stringrequired
Inventorinventor

The creator or inventor of the product.

Example
Reason
Stringsuggested
Inceptioninception

The launch date of the product.

Example
May 2012
Datesuggested
Manufacturermanufacturer

The company or entity that manufactures this product.

Example
Moleskine
Auto value
Stringrequired
Availableavailable

Whether the product is currently available.

Example
Yes
Stringsuggested
Current suppliercurrent supplier

The distributor or entity that is the most current supplier of this product.

Example
Amazon.com
Stringoptional
Last production datelast production

The date of the last known or confirmed date that the product stopped selling or discontinued.

Example
2016
Dateoptional
Modelsmodels

The models of this product.

Example
iriver H100
Stringoptional
Websiteurl Official URL website

The homepage or official URL for this product. It must be at least archived or running.

Example
{{url|example.net}}
URLsuggested
Notesnotes

Additional notes

Stringoptional
qidqid

no description

Unknownoptional
fetchwikidatafetchwikidata

no description

Unknownoptional
suppressfieldssuppressfields

no description

Unknownoptional
product_logoproduct_logo

no description

Unknownoptional
logo_sizelogo_size

no description

Unknownoptional
Logo alt textlogo_alt

Alt text for the logo

Stringoptional
Logo captionlogo_caption

Caption for display under the logo

Contentoptional
image_uprightimage_upright

no description

Unknownoptional
onlysourcedonlysourced

no description

Unknownoptional
noiconnoicon

no description

Unknownoptional
launch yearlaunch year

no description

Unknownoptional
companycompany

no description

Unknownoptional
Sloganslogan tagline

no description

Unknownoptional
Years producedYears produced

The years in which the product was made.

Example
2002 to 2012
Unknownoptional