Bản mẫu:If preview/doc
Đây là một trang con tài liệu sử dụng bản mẫu dành cho Bản mẫu:If preview. Nó gồm có các thông tin hướng dẫn sử dụng, thể loại và các nội dung khác không thuộc về phần trang bản mẫu gốc. |
Bản mẫu này sử dụng Lua: |
This is a template that helps other templates determine if they are being previewed or not, and do or display different things accordingly
Cách sử dụng sửa
{{If preview|value if being previewed|value if not being previewed}}
The first parameter is returned if the page is being previewed, otherwise the second parameter will be returned. Either parameter may be empty.
Các ví dụ sửa
Preview this page to see the effect of previewing on the Example column.
Mã | Giá trị khi được xem trước | Giá trị khi được lưu | Ví dụ |
---|---|---|---|
{{If preview|Có|Không}}
|
Có | Không | Không |
{{If preview|Đỏ}}
|
Đỏ | ||
{{If preview||Xanh}}
|
Xanh | Xanh |