• Trang chính
  • Ngẫu nhiên
  • Đăng nhập
  • Tùy chọn
  • Giới thiệu Wikipedia
  • Lời phủ nhận
Wikibeta, Bách khoa tri thức mở

Bản mẫu:Ifequal

  • Ngôn ngữ
  • Theo dõi
  • Xem mã nguồn
Tài liệu bản mẫu[xem] [sửa] [lịch sử] [làm mới]
This template is used to extend the parser function '#ifeq:' to multiple tests.
  • The returned string is defined TRUE if any test pair of input parameters' satisfies as if presented in 'any single' #ifeq: test.
  • The returned value is essentially TRUE OR FALSE— garbage characters OR a null string, respectively. Thus it is suitable for testing by a simple #if:-then-else conditional on the calling page.
  • Applications are generally to display selective text for a set of pages, as in for example, a common (inter-sister project) usage page for templates, selected by specific page name cases.
  • Applications are generally to categorize differently for a group of sister sites sharing a common categorization schema, as in for example, a Wikpedia's template categories changed forms (late-winter/spring of 2007) from "common category names" with other sister projects to new forms... requiring portable templates to be adjusted by sites.
  • This template takes up to eight pairs of arguments (i.e 16 numbered parameters), tests the odd versus the even, and returns true if any pair matches using the parser function '#ifeq:'.
This can be used to test for criteria which may be satisfied by some combination of multiple magic words, such as {{SITENAME}} or {{PAGENAME}}.
mã ví dụ
{{#if: {{ifequal|{{{1}}}|táo|{{{2}}}|cam|{{{3}}}|lê}}|Yes|No}} round fruits present".
  -- returns true if any pair match so will build the string "Yes round fruits present"
  -- returns false if none match so will build the string:   "No round fruits present"
{{#if: {{#if: {{ifequal|{{{SITENAME}}}|Wikiversity|
{{{PAGENAME}}}|Aircraft|
{{{SITENAME}}}|Wikimedia commons}}||No}}
|outer if's then branch...|outer if's else branch...}}
... inverts the test so tests a condition... with an "inverted result".
--Assuming sites are either Wikiversity or Mediawiki commons returns a null string
  as seen by the second if, which then returns the Null string to the first if... 
  which will expand the specified else condition "outer if's else branch...".

Xem thêm

{{ifeqall}}
Compares one comparison string against up to 10 case strings with optional result string and default result string outputs.
{{ifeqany}}
Compares up to 24 case strings against each other with result string and default result string outputs.
{{ifor}}
Compares up to 30 comparison strings against an equal number of case strings with optional result string and default result string outputs.
  • {{=}}
Tài liệu bên trên được truyền tải từ Bản mẫu:Ifequal/doc. (sửa | lịch sử)
Biên tập viên sửa đổi có thể thử nghiệm trong các trang chỗ thử (tạo | sao) và trường hợp kiểm thử (tạo) của bản mẫu này.
Xin hãy bổ sung các thể loại vào trang con /doc. Các trang con của bản mẫu này.
Lấy từ “https://wikibeta.org/index.php?title=Bản_mẫu:Ifequal&oldid=6641944”
Sửa đổi lần cuối lúc 00:30 vào ngày 15 tháng 11 năm 2016

Ngôn ngữ

    Trang này không có sẵn trong ngôn ngữ khác.

    Wikibeta, Bách khoa tri thức mở
    • Creative Commons Ghi công–Chia sẻ tương tự
    • Powered by MediaWiki
    • Trang này được sửa đổi lần cuối vào ngày 15 tháng 11 năm 2016, 00:30.
    • Nếu không có ghi chú khác, nội dung này được cấp phép Creative Commons Ghi công–Chia sẻ tương tự.
    • Chính sách quyền riêng tư
    • Giới thiệu Wikipedia
    • Lời phủ nhận
    • Phiên bản máy tính