Difference between revisions of "Template:Infobox product"
imported>Laurdecl (Fix) |
imported>Laurdecl (Opt settings) |
||
| Line 4: | Line 4: | ||
| titlestyle = padding-bottom:0.2em;<!--(to prevent title touching box's border)--> | | titlestyle = padding-bottom:0.2em;<!--(to prevent title touching box's border)--> | ||
| title = {{{title|{{PAGENAMEBASE}}}}} | | title = {{{title|{{PAGENAMEBASE}}}}} | ||
| − | | image = {{#invoke:InfoboxImage|InfoboxImage|image={{#invoke:WikidataIB |getValue |P18 |name=image |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |onlysourced=no |noicon=yes|{{{image|}}}}}|size={{{image size|{{{image_size|{{{imagesize|}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|1}}}|alt={{{alt|}}}|suppressplaceholder=yes}} | + | | image = {{#invoke:InfoboxImage|InfoboxImage|image={{#invoke:WikidataIB |getValue |P18 |name=image |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|ALL}}} |onlysourced=no |noicon=yes|{{{image|}}}}}|size={{{image size|{{{image_size|{{{imagesize|}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|1}}}|alt={{{alt|}}}|suppressplaceholder=yes}} |
| captionstyle = display:block;margin-bottom:0.4em; | | captionstyle = display:block;margin-bottom:0.4em; | ||
| caption = {{{caption|}}} | | caption = {{{caption|}}} | ||
| Line 11: | Line 11: | ||
| label1 = Type | | label1 = Type | ||
| − | | data1 = {{#invoke:String2 | sentence | {{#invoke:WikidataIB |getValue |P31 |name=type |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |onlysourced={{{onlysourced|no}}} |noicon={{{noicon|}}} | {{{type|}}} }} }} | + | | data1 = {{#invoke:String2 | sentence | {{#invoke:WikidataIB |getValue |P31 |name=type |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|ALL}}} |onlysourced={{{onlysourced|no}}} |noicon={{{noicon|}}} | {{{type|}}} }} }} |
| label2 = Inventor | | label2 = Inventor | ||
| − | | data2 = {{#invoke:WikidataIB |getValue |P61 |name=inventor |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |onlysourced={{{onlysourced|no}}} |noicon={{{noicon|}}} | {{{inventor|}}} }} | + | | data2 = {{#invoke:WikidataIB |getValue |P61 |name=inventor |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|ALL}}} |onlysourced={{{onlysourced|no}}} |noicon={{{noicon|}}} | {{{inventor|}}} }} |
| label3 = Inception | | label3 = Inception | ||
| − | | data3 = {{#invoke:WikidataIB |getValue |P571 |name=inception |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |onlysourced={{{onlysourced|no}}} |noicon={{{noicon|}}} | {{{launch year|{{{inception|}}}}}} }} | + | | data3 = {{#invoke:WikidataIB |getValue |P571 |name=inception |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|ALL}}} |onlysourced={{{onlysourced|no}}} |noicon={{{noicon|}}} | {{{launch year|{{{inception|}}}}}} }} |
| class4 = brand | | class4 = brand | ||
| label4 = Manufacturer | | label4 = Manufacturer | ||
| − | | data4 = {{#invoke:WikidataIB |getValue |P176 |name= manufacturer |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |onlysourced={{{onlysourced|no}}} |noicon={{{noicon|}}} | {{{manufacturer|{{{company|}}}}}} }} | + | | data4 = {{#invoke:WikidataIB |getValue |P176 |name= manufacturer |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|ALL}}} |onlysourced={{{onlysourced|no}}} |noicon={{{noicon|}}} | {{{manufacturer|{{{company|}}}}}} }} |
| label5 = Available | | label5 = Available | ||
| data5 = {{{available|}}} | | data5 = {{{available|}}} | ||
| Line 29: | Line 29: | ||
| class11 = url | | class11 = url | ||
| label11 = Website | | label11 = Website | ||
| − | | data11 = {{#invoke:WikidataIB |getValue |P856 |name=website |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |onlysourced={{{onlysourced|no}}} |noicon={{{noicon|}}} | {{{website|{{{url|}}}}}} }} | + | | data11 = {{#invoke:WikidataIB |getValue |P856 |name=website |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|ALL}}} |onlysourced={{{onlysourced|no}}} |noicon={{{noicon|}}} | {{{website|{{{url|}}}}}} }} |
| class12 = description | | class12 = description | ||
| data12 = {{#if:{{{notes|}}} |'''Notes'''<br/>{{{notes}}} }} | | data12 = {{#if:{{{notes|}}} |'''Notes'''<br/>{{{notes}}} }} | ||
Revision as of 08:11, 10 June 2017
| This template uses Lua: |
Usage
This template can draw data from Wikidata, assuming it is defined there. Simply use {{Infobox product}}. You may also set values manually:
Template:Parameter names example
Example
| Type | Washing machine |
|---|---|
| Inventor | Andrew Reason |
| Inception | 2009 |
| Manufacturer | Reason company |
| Available | Available |
| Current supplier | Reason |
| Models made | Ultra, 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
See also
- {{Infobox brand}}
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.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Title | title | The title of the product stated in the article or what the article is covering.
| String | optional |
| Image | image | The image that reveals the product stated. Make sure that it is a valued image, as image that are deleted will not show.
| File | suggested |
| Image size | image_size | The size of the image. The default is 250px and must not include "px".
| Number | deprecated |
| Image alternative text | alt | Alternative text describing the image showing the product for visually impaired readers.
| String | optional |
| Image caption | caption | The caption describing the image shown on the infobox. Must be concise and short, not excessively detailed.
| String | optional |
| Type | type | The type of the product stated in the article. Can be verified, but must state the type of product.
| String | required |
| Inventor | inventor | The creator or inventor of the product.
| String | suggested |
| Inception | inception | The launch date of the product.
| Date | suggested |
| Manufacturer | manufacturer | The company or entity that manufactures this product.
| String | required |
| Available | available | Whether the product is currently available.
| String | suggested |
| Current supplier | current supplier | The distributor or entity that is the most current supplier of this product.
| String | optional |
| Last production date | last production | The date of the last known or confirmed date that the product stopped selling or discontinued.
| Date | optional |
| Models | models | The models of this product.
| String | optional |
| Website | url Official URL | The homepage or official URL for this product. It must be at least archived or running.
| URL | suggested |
| Notes | notes | Additional notes | String | optional |
| The above documentation is transcluded from Template:Infobox product/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |