Template:MachineInfoBox: Difference between revisions

From CoMakingSpace Wiki

Stefanr (talk | contribs)
Undo revision 6441 by Stefanr (talk)
Tag: Undo
m Using 0 as default assetid should fix the errors on MachineType pages
 
(97 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<noinclude>{{MachineInfoBox
<noinclude>{{MachineInfoBox
|machine name= Example: 3D Printer
|machine name= Example: 3D Printer
|image=
|german=3D-Drucker
|access=upon introduction
|image=Prusa i3 MK2S.JPG
|status=working
|manual=
|type=[[CNC]] (additive manufacturing)
|location=[[3D Printer Farm|3D printer farm]]
|material=[[3D Printing Materials|1.75 mm filament]]
|material=[[3D Printing Materials|1.75 mm filament]]
|used with=
|used with=
|similar=
|software=[[Cura]]
|firmware=[[Marlin]]
|firmware=[[Marlin]]
|software=[[Cura]]
|assetid=
|tutors=[[User:Mitja|Mitja]], [[User:Lukas|Lukas]]
|extrabox=yes
|manual=
|similar=
}}
}}
 
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 a more or less autonomous device a "machine" and its page should contain this [[InfoBoxes|InfoBox]].


== Documentation ==
== Documentation ==
Line 22: Line 19:
{{MachineInfoBox
{{MachineInfoBox
|machine name=
|machine name=
|german=
|image=
|image=
|synonyms=
|synonyms=
|type=
|manual=
|material=
|material=
|location=
|access=
|status=
|firmware=
|software=
|manual=
|tutors=
|used with=
|used with=
|similar=
|similar=
|software=
|firmware=
|assetid=
}}
}}
</pre>
</pre>
Default values for some parameters exist, other fields will only be shown when used. Make frequent use of the "Show preview" button and it should be clear.
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''':
For example, entering the following leads to the '''box on the right''':
Line 43: Line 37:
{{MachineInfoBox
{{MachineInfoBox
|machine name= Example: 3D Printer
|machine name= Example: 3D Printer
|image=
|german=3D-Drucker
|access=upon introduction
|image=Prusa i3 MK2S.JPG
|status=working
|manual=
|type=[[CNC]] (additive manufacturing)
|location=[[3D Printer Farm|3D printer farm]]
|material=[[3D Printing Materials|1.75 mm filament]]
|material=[[3D Printing Materials|1.75 mm filament]]
|used with=
|used with=
|similar=
|software=[[Cura]]
|firmware=[[Marlin]]
|firmware=[[Marlin]]
|software=[[Cura]]
|assetid=
|tutors=[[User:Mitja|Mitja]], [[User:Lukas|Lukas]]
|manual=
|similar=
}}
}}
</pre>
</pre>


== Bugs/Future Development ==
== Advanced Users (SMW) ==
*"smart" behavior like color change according to status would be nice
There is a "hidden" parameter in this template that's not in the copy template: <code>extrabox</code>. To enable <code>extrabox</code>, just give it any value (e.g. "true", "blablabla") and it should cause the box to behave as an extra without "Has image::".
</noinclude>
 
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 determined from the "assetid" parameter by using data of our internal asset management system. 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. 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!


</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" style="background-color:{{#switch:{{#ask: [[Has Internal AssetID::{{{assetid|0}}}]]|?Has Internal Status_translated|format=plainlist|link=none|headers=hide|mainlabel=-}}| Working = PaleGreen | In Commissioning = orange | Broken = red | grey}}; text-decoration:{{#switch:{{#ask: [[Has Internal AssetID::{{{assetid|0}}}]]|?Has Internal Status_translated|format=plainlist|link=none|headers=hide|mainlabel=-}}| Gone = line-through | none }}"|<small style="float:right">[[Template:MachineInfoBox|MachineInfoBox]]</small><br>
<big>'''{{{machine name|Unnamed Machine}}}'''</big>
<big>'''{{{machine name|Unnamed Machine}}}'''</big>
|-
|-
!colspan="2"| [[File:{{#if: {{{image|}}} | {{{image}}} |machine-default.png}}|frameless|300px]]
!colspan="2"| [[{{#if: {{{extrabox|}}} |File: | Has image::File:}}{{#if: {{{image|}}} |{{{image}}} |machine-default.png}}|frameless|300px]]
|-
|-
{{#if: {{{synonyms|}}} |
{{#if: {{{synonyms|}}} |
Line 75: Line 73:
|}}
|}}
|-
|-
{{#if: {{{type|}}} |
{{#if: {{{assetid|}}} |
{{!}}-
{{!}}-
{{!}} Type:
{{!}} Type:
{{!}} {{{type}}}
{{!}} [[MachineType::{{#ask: [[Has Internal AssetID::{{{assetid}}}]]|?Has Internal Category|format=plainlist|link=none|headers=hide|mainlabel=-}}]]
|}}
|}}
|-
|-
Line 93: Line 91:
|}}
|}}
|-
|-
{{#if: {{{location|}}} |
{{#if: {{{assetid|}}} |
{{!}}-
{{!}}-
{{!}} Location:
{{!}} Location:
{{!}} {{{location}}}
{{!}} [[Location::{{#ask: [[Has Internal AssetID::{{{assetid|0}}}]]|?Has Internal Location|format=plainlist|link=none|headers=hide|mainlabel=-}}]]
|}}
|}}
|-
|-
{{#if: {{{access|}}} |
|Access Requirements:
| [[Needs Introduction::{{#ask: [[Introduction for::{{#ask: [[Has Internal AssetID::{{{assetid|0}}}]]|?Has Internal Category|format=plainlist|link=none|headers=hide|default={{PAGENAME}}|mainlabel=-}}]]|format=plainlist|link=none|headers=hide}}]]
|-
{{#if: {{{assetid|}}} |
{{!}}-
{{!}}-
{{!}} Access Requirements:
{{!}} Status:
{{!}} {{{access}}}
{{!}} [[Has InfoBox Status::{{#ask: [[Has Internal AssetID::{{{assetid|0}}}]]|?Has Internal Status_translated|format=plainlist|link=none|headers=hide|mainlabel=-}}]]
|}}
|}}
|-
|-
{{#if: {{{status|}}} |
{{#if: {{{software|}}} |
{{!}}-
{{!}}-
{{!}} Status:
{{!}} Software:
{{!}} {{{status}}}
{{!}} {{{software}}}
|}}
|}}
|-
|-
Line 115: Line 116:
{{!}} Firmware:
{{!}} Firmware:
{{!}} {{{firmware}}}
{{!}} {{{firmware}}}
|}}
|-
{{#if: {{{software|}}} |
{{!}}-
{{!}} Software:
{{!}}  {{{software}}}
|}}
|}}
|-
|-
Line 130: Line 125:
|-  
|-  
| [[Tutors]]:
| [[Tutors]]:
| {{{tutors|}}}
| {{#ask: [[Introduction for::{{#ask: [[Has Internal AssetID::{{{assetid|0}}}]]|?Has Internal Category|format=plainlist|link=none|headers=hide|default={{PAGENAME}}|mainlabel=-}}]] |?Tutor= |format=plainlist |mainlabel=-  |valuesep=<br/>  }}
|-
|-
{{#if: {{{similar|}}} |
{{#if: {{{similar|}}} |
Line 137: Line 132:
{{!}}  {{{similar}}}
{{!}}  {{{similar}}}
|}}  
|}}  
|}
|}  
[[Category:Machines]]
{{#if:{{NAMESPACE}}
|<!-- not main namespace do nothing, otherwise -->
|{{#if: {{{extrabox|}}} | | [[Category:Machines]]}}
}}[[Has caption::{{#if: {{{extrabox|}}} | | {{#ask: [[Has Internal AssetID::{{{assetid|0}}}]]|?Has Internal Category|format=plainlist|link=none|headers=hide|default={{PAGENAME}}|mainlabel=-}}}}|]] [[Has German::{{#if: {{{german|}}} |{{{german}}}|}}| ]] [[Has Asset ID::{{#if: {{{assetid|}}} |{{{assetid}}}|}}| ]] [[Has extrabox::{{#if: {{{extrabox|}}} |yes|}}| ]]
{{#if: {{{assetid|}}}|
[[Has SnipeIT Location::|:]]
[[Has SnipeIT Status::{{#ask: [[Has Internal AssetID::{{{assetid}}}]]|?Has Internal Status|format=plainlist|link=none|headers=hide|mainlabel=-}}|]]
[[Has SnipeIT Status_translated::{{#ask: [[Has Internal AssetID::{{{assetid}}}]]|?Has Internal Status_translated|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 ==
<templatedata>
{
"params": {
"machine name": {
"label": "The name of your machine",
"description": "The name of your machine",
"type": "string",
"default": "Unnamed Machine",
"required": true
},
"german": {
"label": "The (best) German name of your machine (invisible)",
"description": "The (best) German name of your machine (not visible, but usable for advanced pages like automatic galleries)",
"type": "string",
"suggested": true
},
"extrabox": {
"label": "Extrabox? (advanced - if in doubt, ignore this)",
"description": "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.",
"type": "boolean"
},
"image": {
"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. Do not include 'File:' or '[[', just the file name.",
"type": "wiki-file-name",
"default": "machine-default.png",
"suggested": true
},
"synonyms": {
"label": "Synonyms for the machine's name",
"description": "Existing synonyms for the name of the machines. You might include translations here.",
"example": "DE: Bohrmaschine",
"type": "string",
"suggested": true
},
"material": {
"label": "Material the machine can be used with",
"description": "Links to materials the machine can be used with. Links should ideally be within our wiki.",
"example": "[[wood]]",
"type": "wiki-page-name",
"suggested": true
},
"used with": {
"label": "Tools to use the machine with",
"description": "Links to tools the machine can be used with. Links should ideally be within our wiki",
"example": "[[Drill Bits|drill bits]]",
"type": "wiki-page-name"
},
"manual": {
"label": "Link to the manual",
"description": "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",
"type": "url",
"suggested": true
},
"software": {
"label": "Software",
"description": "Does the machine require a computer with a certain software?",
"example": "[[Slic3r]]",
"type": "string"
},
"firmware": {
"label": "Firmware",
"description": "Is a firmware installed on the machine that may need to be maintained?",
"example": "[[Marlin]]",
"type": "string"
},
"similar": {
"label": "Links to similar machines",
"description": "Provide links to similar machines or tools in our wiki.",
"type": "wiki-page-name"
},
"assetid": {
"label": "Asset ID",
"description": "The asset ID in our internal asset management system. Setting this parameter will automatically determine the status, location and type of the tool.",
"type": "number",
"suggested": true
}
},
"description": "We call pretty much all electric devices and big or small power tools \"machines\" in this wiki. Their pages should contain this InfoBox!",
"paramOrder": [
"machine name",
"german",
"image",
"assetid",
"synonyms",
"manual",
"material",
"used with",
"similar",
"software",
"firmware",
"extrabox"
]
}
</templatedata>
</noinclude>

Latest revision as of 23:44, 30 May 2025

MachineInfoBox

Example: 3D Printer

Material: 1.75 mm filament
Access Requirements: The query description has an empty condition.
Software: Cura
Firmware: Marlin
Tutors: The query description has an empty condition.


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=
|manual=
|material=
|used with=
|similar=
|software=
|firmware=
|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
|manual=
|material=[[3D Printing Materials|1.75 mm filament]]
|used with=
|similar=
|software=[[Cura]]
|firmware=[[Marlin]]
|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 determined from the "assetid" parameter by using data of our internal asset management system. 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. 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!


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!

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
The name of your machinemachine name

The name of your machine

Default
Unnamed Machine
Stringrequired
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)

Stringsuggested
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.

Default
machine-default.png
Filesuggested
Asset IDassetid

The asset ID in our internal asset management system. Setting this parameter will automatically determine the status, location and type of the tool.

Numbersuggested
Synonyms for the machine's namesynonyms

Existing synonyms for the name of the machines. You might include translations here.

Example
DE: Bohrmaschine
Stringsuggested
Link to the manualmanual

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

URLsuggested
Material the machine can be used withmaterial

Links to materials the machine can be used with. Links should ideally be within our wiki.

Example
[[wood]]
Page namesuggested
Tools to use the machine withused with

Links to tools the machine can be used with. Links should ideally be within our wiki

Example
[[Drill Bits|drill bits]]
Page nameoptional
Links to similar machinessimilar

Provide links to similar machines or tools in our wiki.

Page nameoptional
Softwaresoftware

Does the machine require a computer with a certain software?

Example
[[Slic3r]]
Stringoptional
Firmwarefirmware

Is a firmware installed on the machine that may need to be maintained?

Example
[[Marlin]]
Stringoptional
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.

Booleanoptional