Template:MachineInfoBox: Difference between revisions
NitramLegov (talk | contribs) (putting german to an if) |
(squeezing all the "invisible" SMW properties together to avoid empty lines at the top of each page the template is used on) |
||
(34 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<noinclude>{{MachineInfoBox | <noinclude>{{MachineInfoBox | ||
|machine name= Example: 3D Printer | |machine name= Example: 3D Printer | ||
|german=3D-Drucker | |||
|image=Prusa i3 MK2S.JPG | |image=Prusa i3 MK2S.JPG | ||
|extrabox=yes | |extrabox=yes | ||
|access= | |access= | ||
|status=working | |status=working | ||
|type= | |type= | ||
|location=[[ | |location=[[Electronics Room|Electronics Room]] | ||
|material=[[3D Printing Materials|1.75 mm filament]] | |material=[[3D Printing Materials|1.75 mm filament]] | ||
|used with= | |used with= | ||
|firmware=[[Marlin]] | |firmware=[[Marlin]] | ||
|software=[[Cura]] | |software=[[Cura]] | ||
|tutors= | |tutors= | ||
|manual= | |manual= | ||
|similar= | |similar= | ||
|assetid= | |||
}} | }} | ||
We call pretty much all electric devices and big or small power tools "[[machines]]" in this wiki. Their pages should contain this [[InfoBoxes|InfoBox]]! | We call pretty much all electric devices and big or small power tools "[[machines]]" in this wiki. Their pages should contain this [[InfoBoxes|InfoBox]]! | ||
Line 28: | Line 30: | ||
|material= | |material= | ||
|location= | |location= | ||
|status= | |status= | ||
|firmware= | |firmware= | ||
|software= | |software= | ||
|manual= | |manual= | ||
|used with= | |used with= | ||
|similar= | |similar= | ||
|assetid= | |||
}} | }} | ||
</pre> | </pre> | ||
Line 44: | Line 45: | ||
{{MachineInfoBox | {{MachineInfoBox | ||
|machine name= Example: 3D Printer | |machine name= Example: 3D Printer | ||
|german= | |german=3D-Drucker | ||
|image=Prusa i3 MK2S.JPG | |image=Prusa i3 MK2S.JPG | ||
|status=working | |status=working | ||
|type= | |type= | ||
|location=[[ | |location=[[Location::Electronics Room|Electronics Room]] | ||
|material=[[3D Printing Materials|1.75 mm filament]] | |material=[[3D Printing Materials|1.75 mm filament]] | ||
|used with= | |used with= | ||
|firmware=[[Marlin]] | |firmware=[[Marlin]] | ||
|software=[[Cura]] | |software=[[Cura]] | ||
|manual= | |manual= | ||
|similar= | |similar= | ||
|assetid= | |||
}} | }} | ||
</pre> | </pre> | ||
Line 64: | Line 64: | ||
You can use it when you '''don't''' want the InfoBox to set a "Has image::" and "Has German::" value (as it automatically does for "image" and "german"). That's useful on pretty much every page with multiple InfoBoxes so there is just one "main" image to represent the page in galleries. | You can use it when you '''don't''' want the InfoBox to set a "Has image::" and "Has German::" value (as it automatically does for "image" and "german"). That's useful on pretty much every page with multiple InfoBoxes so there is just one "main" image to represent the page in galleries. | ||
"Machinetype::" is automatically set from the "type" value. We use this property to [[Project:Navigation_Galleries#Outsourcing_Parts_of_a_Page|"outsource" individual machine pages from the general overview content]], so it is important to get it right. | |||
"Access" and "Tutors" should automatically gather their content from the SMW property "Introduction for::" since January 2022. This works based on the page name or machine type - therefore, the value entered for "type" should be plain text and not a wiki link to avoid query warnings. A link is added automatically for easy navigation to the "parent" page and as an easy way to check possible values. | |||
Questions, feedback and further improvements are welcome! | Questions, feedback and further improvements are welcome! | ||
Line 69: | Line 73: | ||
== Bugs/Future Development == | == Bugs/Future Development == | ||
*"smart" behavior like color change according to status would be nice | *"smart" behavior like color change according to status would be nice | ||
</noinclude> | </noinclude> | ||
{| class="wikitable" style="float:right; margin-left: 10px; border-style: solid; border-width: 5px; border-color: black" | {| class="wikitable" style="float:right; margin-left: 10px; border-style: solid; border-width: 5px; border-color: black" | ||
!colspan="2"|<small style="float:right">[[Template:MachineInfoBox|MachineInfoBox]]</small><br> | !colspan="2"|<small style="float:right">[[Template:MachineInfoBox|MachineInfoBox]]</small><br> | ||
Line 87: | Line 90: | ||
{{!}}- | {{!}}- | ||
{{!}} Type: | {{!}} Type: | ||
{{!}} {{{type}}} | {{!}} [[{{{type}}}]] | ||
|}} | |}} | ||
|- | |- | ||
Line 108: | Line 111: | ||
|}} | |}} | ||
|- | |- | ||
{{# | |Access Requirements: | ||
| {{#ask: [[Introduction for::{{PAGENAME}}]] OR [[Introduction for::{{{type}}}]]}} | |||
|- | |- | ||
{{#if: {{{status|}}} | | {{#if: {{{status|}}} | | ||
{{!}}- | {{!}}- | ||
{{!}} Status: | {{!}} Status: | ||
{{!}} {{{status}}} | {{!}} [[Has InfoBox Status::{{{status}}}]] | ||
|}} | |}} | ||
|- | |- | ||
Line 139: | Line 139: | ||
|- | |- | ||
| [[Tutors]]: | | [[Tutors]]: | ||
| {{{ | | {{#ask: [[Introduction for::{{PAGENAME}}]] OR [[Introduction for::{{{type}}}]] |?Tutor= |format=plainlist |mainlabel=- |valuesep=<br/> }} | ||
|- | |- | ||
{{#if: {{{similar|}}} | | {{#if: {{{similar|}}} | | ||
Line 146: | Line 146: | ||
{{!}} {{{similar}}} | {{!}} {{{similar}}} | ||
|}} | |}} | ||
|} | |} | ||
[[Category:Machines]] | {{#if:{{NAMESPACE}} | ||
[[Has caption::{{#if: {{{extrabox|}}} | |{{PAGENAME}}}}| ]] | |<!-- not main namespace do nothing, otherwise --> | ||
{{#if:{{{german|}}} | [[Has | |{{#if: {{{extrabox|}}} | | [[Category:Machines]]}} | ||
<noinclude> | }}[[Has caption::{{#if: {{{extrabox|}}} | | {{#if: {{{type|}}} |{{{type}}}| {{PAGENAME}}}}}}| ]] [[Has German::{{#if: {{{german|}}} |{{{german}}}|}}| ]] [[MachineType::{{#if: {{{type|}}} |{{{type}}}|}}| ]] [[Has Asset ID::{{#if: {{{assetid|}}} |{{{assetid}}}|}}| ]] [[Has extrabox::{{#if: {{{extrabox|}}} |yes|}}| ]] | ||
{{#if: {{{assetid|}}}|[[Has SnipeIT Category::{{#ask: [[Has Internal AssetID::{{{assetid}}}]]|?Has Internal Category|format=plainlist|link=none|headers=hide|mainlabel=-}}|]] [[Has SnipeIT Location::{{#ask: [[Has Internal AssetID::{{{assetid}}}]]|?Has Internal Location|format=plainlist|link=none|headers=hide|mainlabel=-}}|]] [[Has SnipeIT Status::{{#ask: [[Has Internal AssetID::{{{assetid}}}]]|?Has Internal Status|format=plainlist|link=none|headers=hide|mainlabel=-}}|]] [[Has SnipeIT Status Type::{{#ask: [[Has Internal AssetID::{{{assetid}}}]]|?Has Internal Status type|format=plainlist|link=none|headers=hide|mainlabel=-}}|]] [[Has SnipeIT Status Meta::{{#ask: [[Has Internal AssetID::{{{assetid}}}]]|?Has Internal Status meta|format=plainlist|link=none|headers=hide|mainlabel=-}}|]]|}}<noinclude> | |||
== Template Parameters == | == Template Parameters == | ||
<templatedata> | <templatedata> | ||
Line 175: | Line 177: | ||
"image": { | "image": { | ||
"label": "An image of the machine (example.jpg)", | "label": "An image of the machine (example.jpg)", | ||
"description": "The file name of the image which best represents the machine. If you do not fill the parameter \"extrabox\", this will be added to the page as a Semantic MediaWiki property.", | "description": "The file name of the image which best represents the machine. If you do not fill the parameter \"extrabox\", this will be added to the page as a Semantic MediaWiki property. Do not include 'File:' or '[[', just the file name.", | ||
"type": "wiki-file-name", | "type": "wiki-file-name", | ||
"default": "machine-default.png", | "default": "machine-default.png", | ||
Line 189: | Line 191: | ||
"type": { | "type": { | ||
"label": "Which type of machine is it?", | "label": "Which type of machine is it?", | ||
"description": "Which type of machine is this InfoBox referring to? ", | "description": "Which type of machine is this InfoBox referring to? Plain text please, will be linked automatically", | ||
"example": " | "example": "Circular Saw / Corded Drill", | ||
"suggested": true, | "suggested": true, | ||
"type": "string" | "type": "string" | ||
Line 222: | Line 224: | ||
"access": { | "access": { | ||
"label": "Access requirements", | "label": "Access requirements", | ||
"description": " | "description": "Currently unused - previously indicated the access requirements to use the machine", | ||
"example": "[[introduction]]", | "example": "[[introduction]]", | ||
"type": "string" | "type": "string" | ||
}, | }, | ||
"tutors": { | "tutors": { | ||
"label": "Tutors for the machine", | "label": "Tutors for the machine", | ||
"description": " | "description": "Currently unused - previously list of tutors who can give introductions to the machine", | ||
"example": "[[Tutor::User:Lukas|Lukas]]", | "example": "[[Tutor::User:Lukas|Lukas]]", | ||
"type": "string" | "type": "string" | ||
Line 255: | Line 256: | ||
"description": "Provide links to similar machines or tools in our wiki.", | "description": "Provide links to similar machines or tools in our wiki.", | ||
"type": "wiki-page-name" | "type": "wiki-page-name" | ||
}, | |||
"assetid": { | |||
"label": "Asset ID", | |||
"description": "The asset id in our internal asset management system", | |||
"type": "number" | |||
} | } | ||
}, | }, | ||
Line 274: | Line 280: | ||
"software", | "software", | ||
"firmware", | "firmware", | ||
"extrabox" | "extrabox", | ||
"assetid" | |||
] | ] | ||
} | } | ||
</templatedata> | </templatedata> | ||
</noinclude> | </noinclude> |
Latest revision as of 13:21, 22 April 2024
MachineInfoBox Example: 3D Printer | |
---|---|
Material: | 1.75 mm filament |
Location: | Electronics Room |
Access Requirements: | Some use of "" in your query was not closed by a matching "". |
Status: | working |
Firmware: | Marlin |
Software: | Cura |
Tutors: | Some use of "" in your query was not closed by a matching "". |
We call pretty much all electric devices and big or small power tools "machines" in this wiki. Their pages should contain this InfoBox!
Documentation
To use this template, simply copy this code into your page and enter the relevant parameters:
{{MachineInfoBox |machine name= |german= |image= |synonyms= |type= |material= |location= |status= |firmware= |software= |manual= |used with= |similar= |assetid= }}
Most fields will only be shown when used, so the box can be more or less detailed. Make frequent use of the "Show preview" button and it should be clear.
For example, entering the following leads to the box on the right:
{{MachineInfoBox |machine name= Example: 3D Printer |german=3D-Drucker |image=Prusa i3 MK2S.JPG |status=working |type= |location=[[Location::Electronics Room|Electronics Room]] |material=[[3D Printing Materials|1.75 mm filament]] |used with= |firmware=[[Marlin]] |software=[[Cura]] |manual= |similar= |assetid= }}
Advanced Users (SMW)
There is a "hidden" parameter in this template that's not in the copy template: extrabox
. To enable extrabox
, just give it any value (e.g. "true", "blablabla") and it should cause the box to behave as an extra without "Has image::".
You can use it when you don't want the InfoBox to set a "Has image::" and "Has German::" value (as it automatically does for "image" and "german"). That's useful on pretty much every page with multiple InfoBoxes so there is just one "main" image to represent the page in galleries.
"Machinetype::" is automatically set from the "type" value. We use this property to "outsource" individual machine pages from the general overview content, so it is important to get it right.
"Access" and "Tutors" should automatically gather their content from the SMW property "Introduction for::" since January 2022. This works based on the page name or machine type - therefore, the value entered for "type" should be plain text and not a wiki link to avoid query warnings. A link is added automatically for easy navigation to the "parent" page and as an easy way to check possible values.
Questions, feedback and further improvements are welcome!
Bugs/Future Development
- "smart" behavior like color change according to status would be nice
MachineInfoBox Unnamed Machine | |
---|---|
Access Requirements: | |
Tutors: |
Template Parameters
We call pretty much all electric devices and big or small power tools "machines" in this wiki. Their pages should contain this InfoBox!
Parameter | Description | Type | Status | |
---|---|---|---|---|
The name of your machine | machine name | The name of your machine
| String | required |
The (best) German name of your machine (invisible) | german | The (best) German name of your machine (not visible, but usable for advanced pages like automatic galleries) | String | suggested |
An image of the machine (example.jpg) | image | The file name of the image which best represents the machine. If you do not fill the parameter "extrabox", this will be added to the page as a Semantic MediaWiki property. Do not include 'File:' or '[[', just the file name.
| File | suggested |
Synonyms for the machine's name | synonyms | Existing synonyms for the name of the machines. You might include translations here.
| String | suggested |
Which type of machine is it? | type | Which type of machine is this InfoBox referring to? Plain text please, will be linked automatically
| String | suggested |
The status of the machine | status | The status of the machine - link the corresponding "do-something" issue in case of problems!
| String | optional |
Material the machine can be used with | material | Links to materials the machine can be used with. Links should ideally be within our wiki.
| Page | suggested |
Tools to use the machine with | used with | Links to tools the machine can be used with. Links should ideally be within our wiki
| Page | optional |
Links to similar machines | similar | Provide links to similar machines or tools in our wiki. | Page | optional |
The location of the tool | location | The location of the tool within the CoMakingSpace
| Page | suggested |
Access requirements | access | Currently unused - previously indicated the access requirements to use the machine
| String | optional |
Tutors for the machine | tutors | Currently unused - previously list of tutors who can give introductions to the machine
| String | optional |
Link to the manual | manual | Link to the manual of the machine. This should be a public source. If there is no link, indicate where the manual is located in the CoMakingSpace. Leave empty if not applicable | URL | suggested |
Software | software | Does the machine require a computer with a certain software?
| String | optional |
Firmware | firmware | Is a firmware installed on the machine that may need to be maintained?
| String | optional |
Extrabox? (advanced - if in doubt, ignore this) | extrabox | Apply this parameter if you use the template as an additional InfoBox on a machine page with an existing "main" box. This will remove the "Has Image" parameter from this infobox so its image is NOT included as an SMW property of the page. | Boolean | optional |
Asset ID | assetid | The asset id in our internal asset management system | Number | optional |