Difference between revisions of "Template:MaterialBtn"

From The Powder Toy
Jump to: navigation, search
(add image caption back in, in case the image doesn't exist)
(Add link and size arguments)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<includeonly>[[File:{{#if: {{{mat|}}} | {{{mat}}} | {{{1}}}}}.png|30px|link=Element:{{#if: {{{mat|}}} | {{{mat}}} | {{{1}}}}}|{{#if: {{{mat|}}} | {{{mat}}} | {{{1}}}}}]]</includeonly><noinclude>Displays the menu-button image for an element, and links it to the element page. Takes one argument, the name of a material.
+
<includeonly>[[File:{{#if: {{{mat|}}} | {{{mat}}} | {{{1}}}}}.png|{{#if: {{{size|}}} | {{{size}}} | 30px }}|{{#if: {{{link|}}} | link={{{link}}} | link=Element:{{#if: {{{mat|}}} | {{{mat}}} | {{{1}}}}}|{{#if: {{{mat|}}} | {{{mat}}} | {{{1}}}}}}}]]</includeonly><noinclude>Displays the menu-button image for an element, and links it to the element page. Takes one argument, the name of a material.
 
Example: <nowiki> {{ MaterialBtn | PSCN }} </nowiki> and you will get:
 
Example: <nowiki> {{ MaterialBtn | PSCN }} </nowiki> and you will get:
 +
 
{{ MaterialBtn | PSCN }}
 
{{ MaterialBtn | PSCN }}
 +
 +
The optional '''link''' argument lets you direct to a page other than an element page. For example, this <nowiki>{{ MaterialBtn | Wall_Erase | link=Elements::Walls}}</nowiki> will direct to the page on walls:
 +
 +
{{ MaterialBtn | Wall_Erase | link=Elements::Walls}}
 +
 +
The optional '''size''' argument controls the size of the button. The default is 30px, to double it you can use <nowiki>{{ MaterialBtn | PSCN | size=60px}}</nowiki>:
 +
 +
{{ MaterialBtn | PSCN | size=60px}}
 +
 +
== Usage guidelines ==
 +
 +
MaterialBtn should be used sparingly, and never in the middle of paragraphs (preferably in short lines only).
 +
 +
Excessive use, or use in the middle of paragraphs, is distracting and hinders comprehension.
 +
 +
MaterialBtns can be used like headings - they help to indicate the subject(s) of a particular section of text. However, for this to work:
 +
* the MaterialBtn should be the main subject of the section of text, rather than a bit of extra detail in a paragraph
 +
* the text related to the MaterialBtn should be on its own, not part of a paragraph that talks about many different things
 +
 +
Lists of MaterialBtns are fine, but should not be part of a paragraph - put them on a separate line.
 +
 +
If possible, MaterialBtns should line up (e.g. at the left hand side of the page), so that they look neat and tidy.
 +
 +
If you use a MaterialBtn as part of a paragraph, put it near the start (ideally it should be the first thing in the paragraph, so that MaterialBtns in different paragraphs line up).
 +
 +
== Examples ==
 +
 +
This is an example of what to avoid (from Element:PROT). It looks somewhat messy and is hard to read (the colours are distracting):
 +
 +
:{{MaterialBtn | DEUT }} will explode into protons when bombarded with them for a while, just like the reaction with {{MaterialBtn | NEUT }} except with low pressure. Protons, when with high velocity enough, will turn into other materials, in order from lowest to highest velocity required to produce: {{MaterialBtn | NBLE }}, {{MaterialBtn | CO2 }}, {{MaterialBtn | OXYG }}, {{MaterialBtn | PLSM }}, {{MaterialBtn | URAN }}, {{MaterialBtn | PLUT }}, and {{MaterialBtn | SING }} (needs extremely high velocity).
 +
 +
 +
 +
A better version. DEUT is the subject of the paragraph, so is rendered as a MaterialBtn. NEUT is just used to describe how DEUT reacts and is not the subject of the paragraph, so is a normal Material link (or could be plain text). DEUT+PROT and PROT+PROT are different subjects so different paragraphs. The MaterialBtn list is no longer inlined in the paragraph.
 +
 +
:{{MaterialBtn | DEUT }} will explode into protons when bombarded with them for a while, just like the reaction with {{Material | NEUT }} except with low pressure.
 +
 +
:When protons collide with high enough velocity, they will turn into other materials. In order from lowest to highest velocity required to produce, these are:
 +
::{{MaterialBtn | NBLE }} {{MaterialBtn | CO2 }} {{MaterialBtn | OXYG }} {{MaterialBtn | PLSM }} {{MaterialBtn | URAN }} {{MaterialBtn | PLUT }} {{MaterialBtn | SING }}
 +
:(SING needs extremely high velocity).
 +
 +
 +
 +
 +
MaterialBtns can also be used for pretty lists of reactions:
 +
 +
:{{MaterialBtn | PROT }} + {{MaterialBtn | ELEC}} = {{MaterialBtn | HYGN}}<br>
 +
:{{MaterialBtn | PROT }} + {{MaterialBtn | INVS }} = {{MaterialBtn | NEUT}}
 +
 
</noinclude>
 
</noinclude>

Latest revision as of 05:15, 1 February 2024

Displays the menu-button image for an element, and links it to the element page. Takes one argument, the name of a material. Example: {{ MaterialBtn | PSCN }} and you will get:

PSCN.png

The optional link argument lets you direct to a page other than an element page. For example, this {{ MaterialBtn | Wall_Erase | link=Elements::Walls}} will direct to the page on walls:

Wall Erase.png

The optional size argument controls the size of the button. The default is 30px, to double it you can use {{ MaterialBtn | PSCN | size=60px}}:

PSCN.png

Usage guidelines

MaterialBtn should be used sparingly, and never in the middle of paragraphs (preferably in short lines only).

Excessive use, or use in the middle of paragraphs, is distracting and hinders comprehension.

MaterialBtns can be used like headings - they help to indicate the subject(s) of a particular section of text. However, for this to work:

  • the MaterialBtn should be the main subject of the section of text, rather than a bit of extra detail in a paragraph
  • the text related to the MaterialBtn should be on its own, not part of a paragraph that talks about many different things

Lists of MaterialBtns are fine, but should not be part of a paragraph - put them on a separate line.

If possible, MaterialBtns should line up (e.g. at the left hand side of the page), so that they look neat and tidy.

If you use a MaterialBtn as part of a paragraph, put it near the start (ideally it should be the first thing in the paragraph, so that MaterialBtns in different paragraphs line up).

Examples

This is an example of what to avoid (from Element:PROT). It looks somewhat messy and is hard to read (the colours are distracting):

DEUT.png will explode into protons when bombarded with them for a while, just like the reaction with NEUT.png except with low pressure. Protons, when with high velocity enough, will turn into other materials, in order from lowest to highest velocity required to produce: NBLE.png, CO2.png, OXYG.png, PLSM.png, URAN.png, PLUT.png, and SING.png (needs extremely high velocity).


A better version. DEUT is the subject of the paragraph, so is rendered as a MaterialBtn. NEUT is just used to describe how DEUT reacts and is not the subject of the paragraph, so is a normal Material link (or could be plain text). DEUT+PROT and PROT+PROT are different subjects so different paragraphs. The MaterialBtn list is no longer inlined in the paragraph.

DEUT.png will explode into protons when bombarded with them for a while, just like the reaction with NEUT except with low pressure.
When protons collide with high enough velocity, they will turn into other materials. In order from lowest to highest velocity required to produce, these are:
NBLE.png CO2.png OXYG.png PLSM.png URAN.png PLUT.png SING.png
(SING needs extremely high velocity).



MaterialBtns can also be used for pretty lists of reactions:

PROT.png + ELEC.png = HYGN.png
PROT.png + INVS.png = NEUT.png