Difference between revisions of "Template:Matches/doc"

From blackwiki
Jump to navigation Jump to search
imported>SimonTrew
(→‎Parameters: image size)
imported>Vanisaac
m (→‎Examples: clean up per WP:CAT#T and WP:AWBREQ add template:Sandbox other)
 
(2 intermediate revisions by one other user not shown)
Line 2: Line 2:
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
  
Produces a {{tlx|tick}} if the two parameters match lexically, a {{tlx|cross}} otherwise. Quick and easy, for use in template testcases. The test is case-sensitive, it uses <code>#ifeq:</code>.
+
==TemplateData==
 
+
{{TemplateData header}}
== Parameters ==
+
<TemplateData>
{{tlx|matches|''first-value''|''second-value''|4=''size=nn''}}
+
{
 
+
        "description": "Invokes [[:Template:tick]] if the two parameters match lexically, [[:Template:cross]] otherwise. Quick and easy, for use in template testcases. The test is case-sensitive, it uses <code>#ifeq:</code>.",
The ''size'' parameter is the image size. If omitted, it defaults to 10.
+
        "params": {
 +
                "1": {
 +
                        "label": "first-value",
 +
                        "description": "First of two strings to compare",
 +
                        "type": "string",
 +
                        "required": true
 +
                },
 +
                "2": {
 +
                        "label": "second-value",
 +
                        "description": "Second of two strings to compare",
 +
                        "type": "string",
 +
                        "required": true
 +
                },
 +
                "size": {
 +
                        "label": "size",
 +
                        "description": "Size of the tick or cross images",
 +
                        "type": "number",
 +
                        "required": false,
 +
                        "default": "10"
 +
                }
 +
        }
 +
}
 +
</TemplateData>
  
 
== Examples ==
 
== Examples ==
Line 15: Line 37:
 
{{tlx|matches|hello|goodbye|4=size=55}} → {{matches|hello|goodbye|size=55}}<br/>
 
{{tlx|matches|hello|goodbye|4=size=55}} → {{matches|hello|goodbye|size=55}}<br/>
  
<includeonly>
+
<includeonly>{{Sandbox other||
 
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
 
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
 
[[Category:Wikipedia metatemplates]]
 
[[Category:Wikipedia metatemplates]]
</includeonly>
+
}}</includeonly>

Latest revision as of 00:48, 26 April 2020

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for Matches

Invokes [[:Template:tick]] if the two parameters match lexically, [[:Template:cross]] otherwise. Quick and easy, for use in template testcases. The test is case-sensitive, it uses <code>#ifeq:</code>.

Template parameters

ParameterDescriptionTypeStatus
first-value1

First of two strings to compare

Stringrequired
second-value2

Second of two strings to compare

Stringrequired
sizesize

Size of the tick or cross images

Default
10
Numberoptional

Examples

{{matches|hello|hello}}☑Y {{matches|hello|goodbye}}

  1. REDIRECT Template:Xmark


{{matches|hello|hello|size=55}}☑Y {{matches|hello|goodbye|size=55}}

  1. REDIRECT Template:Xmark