Template:Grid: Difference between revisions

From TerraFirmaCraft Plus Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
(No difference)

Latest revision as of 10:54, 18 April 2020

Template documentation (for the above template, sometimes hidden or invisible)

The grid template is a singular grid cell, which has the ability to display any image (usually a block or item) that is uploaded as Grid <Name>.png, within it.

Usage

All inputs are optional (however Amount, Mod, Link and Title won't do anything without Name):

{{Grid
|Mod:Name,Amount
|mod=Default mod (useful for animations and layout templates)
|default=Image always shown under the main image
|align=Vertical Alignment
|link=Link override
|title=Title, removes link
|class=Adds additional classes to the .grid class
}}

Examples

To display this image File:Grid Raw Porkchop.png with an amount of 20 you would put: {{Grid|Raw Porkchop,20}}

shows

Raw Porkchop20

An amount of 2 - 999 is supported, anything else will not be displayed. Note, the automatic link is removed if {{SUBPAGENAME}} is the same as the item name. This is to help prevent self-links, use the link parameter to re-add the link if you need it.


If no image is specified, the background will be added on its own, this could be used to do layouts like so:

{{Grid|Gunpowder}}{{Grid|Gunpowder}}{{Grid}}{{Grid}}{{Grid|Gunpowder}}{{Grid|Gunpowder}}<br>
{{Grid|Gunpowder}}{{Grid|Gunpowder}}{{Grid}}{{Grid}}{{Grid|Gunpowder}}{{Grid|Gunpowder}}<br>
{{Grid}}{{Grid}}{{Grid|Gunpowder}}{{Grid|Gunpowder}}{{Grid}}{{Grid}}<br>
{{Grid}}{{Grid|Gunpowder}}{{Grid|Gunpowder}}{{Grid|Gunpowder}}{{Grid|Gunpowder}}{{Grid}}<br>
{{Grid}}{{Grid|Gunpowder}}{{Grid|Gunpowder}}{{Grid|Gunpowder}}{{Grid|Gunpowder}}{{Grid}}<br>
{{Grid}}{{Grid|Gunpowder}}{{Grid}}{{Grid}}{{Grid|Gunpowder}}{{Grid}}
shows

GunpowderGunpowderGunpowderGunpowder
GunpowderGunpowderGunpowderGunpowder
GunpowderGunpowder
GunpowderGunpowderGunpowderGunpowder
GunpowderGunpowderGunpowderGunpowder
GunpowderGunpowder


Grids can be animated with a theoretically unlimited amount of frames, between mod items and vanilla items. Frames are separated by semi-colons (;). {{Grid|Dirt;TNT,64;Grass Block,5;Sand;Gold Helmet,12;Redstone}}

shows

Dirt


Align uses the vertical-align CSS property. For example to align to the middle: Smells like {{Grid|Raw Porkchop|align=middle}} in here!

shows

Smells like Raw Porkchop in here!


To change the link from the image name put: {{Grid|Charcoal|link=Coal#Charcoal}}

shows

Charcoal


To remove the link, set link to none: {{Grid|Charcoal|link=none}}

shows

Charcoal

Note that this retains the title.


To add a different title, put: {{Grid|Raw Porkchop|title=Smelly Pork}}

shows

Smelly Porkchop


To remove the title, set title to none: {{Grid|Raw Porkchop|title=none}}

shows

Raw Porkchop

Note that setting title will remove the link, due to a limitation in the software.


Other templates

These templates implement this template into a GUI screen which mimics how it would look in Minecraft. Thus, they have mostly the same features as this template.




Visit Template:Grid/doc to edit this text! (How does this work?)