Szablon:Bool

Z Terraria Wiki
Przejdź do nawigacji Przejdź do wyszukiwania
Template-info.svg Dokumentacja Poniższa dokumentacja jest załączona do Szablon:Bool/doc. (edytuj | historia)

This simple helper template will display y if its input is y, yes, true, or 1. It will not display anything otherwise.

This functionality is useful for templates where a parameter should only have an effect if it is set to one of these positive values. It is especially helpful for the integration of TemplateData, which sets a parameter that is marked as Boolean to 0 if it is added and de-selected.

Usage

{{ bool | <string> }}

First unnamed parameter

The input string to check.

Examples

Code Result
{{bool|y}} y
{{bool|yes}} y
{{bool|true}} y
{{bool|1}} y
{{bool|n}}
{{bool|no}}
{{bool|false}}
{{bool|0}}
{{bool|foo}}
{{#if:{{bool|{{{format|yes}}}}}|format|don't format}} format
{{#if:{{bool|{{{format|false}}}}}|format|don't format}} don't format