Bản mẫu:Collapsible 2 test case

Tài liệu bản mẫu[xem] [sửa] [lịch sử] [làm mới]

This template creates a test case of two or more templates contained in a collapsible box. If the outputs of all the templates is the same, the box is collapsed, but if any of them differ from each other the box is left uncollapsed. There are a variety of different formats and options that can be used.

Each template is called with the same parameters. All parameters passed to this template are passed through to the test-case templates, with the exception of parameters starting with an underscore character ("_"), which are reserved for internal use.

If no templates are specified explicitly, the module uses the base page of the current page as the first template, and its /sandbox subpage as the second template. If only one template is specified explicitly, its /sandbox subpage is used as the second template.

Cách sử dụng sửa

Cú pháp cơ bản

{{collapsible test case
| [param1] = [value1]
| [param2] = [value2]
| [param3] = [value3]
...
}}

Cú pháp đầy đủ

For the full syntax, see Bản mẫu:Test case. This template is equivalent to that one with the |_collapsible= parameter set to "yes" by default.

Các ví dụ sửa

So sánh bản mẫu và hộp nháp (định dạng mặc định) sửa

Cách sử dụng
{{collapsible test case
| _template1 = ombox
| text = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.
}}
Đầu ra
{{ombox}}

{{ombox}}

{{ombox/sandbox}}

So sánh hai bản mẫu khác nhau (định dạng mặc định) sửa

Cách sử dụng
{{collapsible test case
| _template1 = ombox
| _template2 = tmbox
| text = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.
}}
Đầu ra
{{ombox}}

{{ombox}}

{{tmbox}}

So sánh bản mẫu và hộp nháp (định dạng hàng) sửa

Cách sử dụng
{{collapsible test case
| _format = rows
| _template1 = ombox
| text = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.
}}
Đầu ra
{{ombox}}
{{ombox}}
{{ombox/sandbox}}

So sánh bản mẫu và hộp nháp (định dạng cột) sửa

Cách sử dụng
{{collapsible test case
| _format = columns
| _template1 = ombox
| text = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.
}}
Đầu ra
{{ombox}}
So sánh hai bên
{{ombox}}{{ombox/sandbox}}

So sánh bản mẫu và hộp nháp (định dạng nội tuyến, hiển thị mã) sửa

Cách sử dụng
{{collapsible test case
| _format = inline
| _showcode = yes
| _template1 = ombox
| text = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.
}}
Đầu ra
{{ombox}}
  • {{ombox|text=Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.}}
  • {{ombox/sandbox|text=Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.}}

Xem thêm sửa

Bản mẫu đang gọi Mô đun:Template test case: