Templat:Yesno: Perbezaan antara semakan
Penampilan
Kandungan dihapus Kandungan ditambah
Mencipta laman baru dengan kandungan '{{#switch: {{lc: {{{1|¬}}} }} |no |n |0 = {{{no|<!-- null -->}}} | = {{{blank|{{{no|<!-- null -->}}}}}} |¬ = {{{¬|}}} |yes |y ...' |
mengemaskini |
||
(3 semakan pertengahan oleh 2 orang pengguna tidak dipaparkan) | |||
Baris 1: | Baris 1: | ||
{{#switch: {{lc: {{{1|¬}}} }} |
{{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: {{{1|¬}}} }} |
||
|tidak |
|||
|salah |
|||
|no |
|no |
||
|n |
|n |
||
|f |
|||
|false |
|||
|off |
|||
|0 = {{{no|<!-- null -->}}} |
|0 = {{{no|<!-- null -->}}} |
||
| = {{{blank|{{{no|<!-- null -->}}}}}} |
| = {{{blank|{{{no|<!-- null -->}}}}}} |
||
|¬ = {{{¬|}}} |
|¬ = {{{¬|}}} |
||
|ya |
|||
|betul |
|||
|yes |
|yes |
||
|y |
|y |
||
|t |
|||
|true |
|||
|on |
|||
|1 = {{{yes|yes}}} |
|1 = {{{yes|yes}}} |
||
|#default = {{{def|{{{yes|yes}}}}}} |
|#default = {{{def|{{{yes|yes}}}}}} |
||
}}<noinclude> |
}}<noinclude> |
||
{{ |
{{Documentation}} |
||
{{documentation}} |
|||
</noinclude> |
</noinclude> |
Semakan semasa pada 13:49, 3 September 2020
Templat ini digunakan dalam sangat banyak laman. Untuk mengelakkan gangguan yang besar dan beban pelayan yang tidak diperlukan, perubahan kepada templat ini seharusnya hendaklah diuji di sublaman /kotak pasir atau /ujian templat ini, ataupun dalam atau di dalam sublaman pengguna. Perubahan yang sudah dicuba bolehlah ditambahkan dengan satu suntingan ke dalam templat ini. Sila bincangkan perubahan-perubahan tersebut terlebih dahulu pada laman perbincangan sebelum melaksanakannya. |
This template normalises an input to be a yes/no output.
Usage
[sunting sumber]The template has five possible outputs depending on the default parameter (input if you will).
In its simplest usage these will all be either "yes" or "" (blank - nothing no characters).
- {{yesno|yes}} result "yes" (also applies to "Yes", "YeS", etc, "Y", "y" and "1")
- {{yesno|no}} result "" (also applies to "No", "NO", "nO", "N", "n" and "0")
- {{yesno}} result ""
- {{yesno|¬}} result ""
- {{yesno|purplemonkeydishwasher}} result "yes" (also applies to any other value not given above).
Each of these can be over-ridden.
- {{yesno|yes|yes=bacon}} result "bacon" (also applies to "Yes", "YeS", etc, "Y", "y" and "1")
- {{yesno|no|no=ham}} result "ham" (also applies to "No", "NO", "nO", "N", "n" and "0")
- {{yesno|blank= eggs}} result "eggs"
- but {{yesno|no=ham}} result "ham"
- and {{yesno|blank= eggs|no=ham}} result "eggs"
- {{yesno|¬|¬=sausage}} result "sausage"
- {{yesno|purplemonkeydishwasher|def=cup-of-tea}} result "cup-of-tea" (also applies to any other value not given above).
- but {{yesno|purplemonkeydishwasher|yes=bacon}} result "bacon"
- but {{yesno|purplemonkeydishwasher|def=cup-of-tea|yes=bacon}} result "cup-of-tea"
This may be used (apparently perversely) thus:
- {{yesno|yes|yes=no|no=yes}} result "no"
- {{yesno|no|yes=no|no=yes}} result "yes"
This creates a logical inversion.