Template:Block: Difference between revisions
Nikitaivanov (talk | contribs) (Created page with "<includeonly>{{Infobox |title={{{title|{{PAGENAME}}}}} |image={{{image}}} |label1=Type |data1={{#switch:{{{type}}}|s=Script block|p=Physics|#default=Normal}} |label2=Collider |data2={{#switch:{{{collider}}}|b=Box|s=Sphere|#default=None}} |header3=Ports |label3={{#if:{{{input1|}}}|Inputs}} |data3=<ul>{{ #if:{{{input1|}}}|<li>{{{input1}}}</li>}}{{ #if:{{{input2|}}}|<li>{{{input2}}}</li>}}{{ #if:{{{input3|}}}|<li>{{{input3}}}</li>}}{{ #if:{{{input4|}}}|<li>{{{input4}}}</li>...") |
-u ndefined- (talk | contribs) m (Protected "Template:Block": Template is used in hundreds of pages. ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))) |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 6: | Line 6: | ||
|label2=Collider | |label2=Collider | ||
|data2={{#switch:{{{collider}}}|b=Box|s=Sphere|#default=None}} | |data2={{#switch:{{{collider}}}|b=Box|s=Sphere|#default=None}} | ||
| | |label3={{#if:{{{folder|}}}|Folder}} | ||
| | |data3={{#if:{{{folder|}}}|[[Editor#{{ucfirst:{{{folder}}}}}|{{ucfirst:{{{folder}}}}}]] | ||
| | }} | ||
#if:{{{input1|}}}| | |header4={{#if:{{{input1|}}} | ||
#if:{{{input2|}}}| | |Ports | ||
#if:{{{input3|}}}| | |{{#if:{{{output1|}}}|Ports}} | ||
#if:{{{input4|}}}| | }} | ||
#if:{{{input5|}}}| | |label4={{#if:{{{input1|}}}|Inputs}} | ||
|data4={{ | |||
| | #if:{{{input1|}}}|{{{input1}}}<br />}}{{ | ||
| | #if:{{{input2|}}}|{{{input2}}}<br />}}{{ | ||
#if:{{{output1|}}}| | #if:{{{input3|}}}|{{{input3}}}<br />}}{{ | ||
#if:{{{output2|}}}| | #if:{{{input4|}}}|{{{input4}}}<br />}}{{ | ||
#if:{{{output3|}}}| | #if:{{{input5|}}}|{{{input5}}}<br />}} | ||
#if:{{{output4|}}}| | |label5={{#if:{{{output1|}}}|Outputs}} | ||
#if:{{{output5|}}}| | |data5={{ | ||
#if:{{{output1|}}}|{{{output1}}}<br />}}{{ | |||
#if:{{{output2|}}}|{{{output2}}}<br />}}{{ | |||
#if:{{{output3|}}}|{{{output3}}}<br />}}{{ | |||
#if:{{{output4|}}}|{{{output4}}}<br />}}{{ | |||
#if:{{{output5|}}}|{{{output5}}}<br />}} | |||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
The '''Block''' template is an [[Template:Infobox|infobox]] for blocks, primarily [[script block]]s. | |||
== Example == | |||
{{Block | {{Block | ||
|title=Absolute | |title=Absolute | ||
|image=Absolute.png | |image=Absolute.png | ||
|type=s | |type=s | ||
|folder=math | |||
|input1={{Port|n}} | |input1={{Port|n}} | ||
|output1={{Port|n}} | |output1={{Port|n}} | ||
}} | }} | ||
{{Block | |||
|title=Box | |||
|image=Box.png | |||
|type=n | |||
|collider=b | |||
|folder=Templates | |||
}} | |||
The example is generated via the following: | |||
<pre> | |||
{{Block | |||
|title=Absolute | |||
|image=Absolute.png | |||
|type=s | |||
|folder=math | |||
|input1={{Port|n}} | |||
|output1={{Port|n}} | |||
}} | |||
</pre> | |||
---- | |||
<pre> | |||
{{Block | |||
|title=Box | |||
|image=Box.png | |||
|type=n | |||
|collider=b | |||
|folder=Templates | |||
}} | |||
</pre> | |||
== Parameters == | |||
Keywords: | |||
* '''title''': Title of block. Defaults to page name if unspecified. | |||
* '''image''': Image of block. Must be provided. | |||
* '''type''': First letter of the type of block in lowercase. If unspecified, defaults to normal. There are two options. | |||
** '''p'''hysics | |||
** '''s'''cript block | |||
* '''collider''': First letter of the [[collider]] of block in lowercase. If unspecified, defaults to normal. There are two options. | |||
** '''b'''ox | |||
** '''s'''phere | |||
* '''folder''': The [[Editor#Inventory|folder]] the block is in. | |||
* '''input#''': <code>#</code> for number. Supports up to five parameters. The input [[Template:Port|port]]s of the block, from left to right, top to bottom. | |||
* '''output#''': <code>#</code> for number. Supports up to five parameters. The output ports of the block, from left to right, top to bottom. | |||
[[Category:Infoboxes]] | |||
</noinclude> | </noinclude> |
Latest revision as of 08:26, 27 July 2025
The Block template is an infobox for blocks, primarily script blocks.
Example
Absolute
Type | Script block |
Collider | None |
Folder | Math |
Ports | |
---|---|
Inputs | Number |
Outputs | Number |
Box
Type | Normal |
Collider | Box |
Folder | Templates |
The example is generated via the following:
{{Block |title=Absolute |image=Absolute.png |type=s |folder=math |input1={{Port|n}} |output1={{Port|n}} }}
{{Block |title=Box |image=Box.png |type=n |collider=b |folder=Templates }}
Parameters
Keywords:
- title: Title of block. Defaults to page name if unspecified.
- image: Image of block. Must be provided.
- type: First letter of the type of block in lowercase. If unspecified, defaults to normal. There are two options.
- physics
- script block
- collider: First letter of the collider of block in lowercase. If unspecified, defaults to normal. There are two options.
- box
- sphere
- folder: The folder the block is in.
- input#:
#
for number. Supports up to five parameters. The input ports of the block, from left to right, top to bottom. - output#:
#
for number. Supports up to five parameters. The output ports of the block, from left to right, top to bottom.