November 4th, 2019

🕒 Wiki Weekly #25! 🕑

It's November!
We've listed pages that need some love. Take a look!

Latest Announcements

Template:Check

From Zelda Wiki, the Zelda encyclopedia
Jump to: navigation, search

0

Purpose

This template is a simple logical check template intended to be used as a tool with other templates that checks to see if the first element exists within a specified list of words. It returns a 1 if it is and a 0 if it isn't. An example is to check the name of a page against a list of page names to see if the current page is speficied within that list of page names.

Usage

To use this template, type:     {{Check|Checked Text |Compared Text }}

  • Checked Text — This is the text you want to be evaluated.
  • Compared Text — This is a list of words or phrases you want the Checked Text to be compared against. Separate each word/phrase by a pipe ( | ), with a limit of up to 32 text strings.

If the Check Text is found to be a word or phrase specified in the Compared Text, the template will return a 1. If it's not, it'll return a 0. When using this template in other templates, you should probably use this in a conditional statement.

And example of its use would be:

{{Check|{{PAGENAME}}|Link|Ganondorf|Princess Zelda}}

If this were placed on either the Link, Ganondorf, or Princess Zelda page, the template would return a 1, on any other page it'd return a 0.

Examples

A basic example of how it the template can work is as follows:

  • {{Check|Link|Link|Ganondorf|Princess Zelda}}
    • 1
  • {{Check|Ganondorf|Link|Ganondorf|Princess Zelda}}
    • 1
  • {{Check|Princess Zelda|Link|Ganondorf|Princess Zelda}}
    • 1
  • {{Check|Midna|Link|Ganondorf|Princess Zelda}}
    • 0

A built-in safeguard prevents null values from returning false positives, as seen with:

  • {{Check||Link|Ganondorf|Princess Zelda}}
    • 0