Bản mẫu:Tìm kiếm sách

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

Usage[sửa]

Standard parameters[sửa]

{{Book search|float= |style= }}

All parameters[sửa]

{{Book search
 | float             =
 | class             =
 | style             =
 | px                =
 | image             =
 | background        =
 | type              =
 | buttonlabel       =
 | searchbuttonlabel =
 | break             =
 | prefix            =
 | width             =
 | placeholder       =
}}
  • float: left|center|right (default: right)
  • class: Additional CSS classes
  • style: simple|image (default: simple, undefined values rendered as image)
    • simple: Show only the search box
    • image: Add a search icon and grey bounding box
  • px: Overall template width (default: 250px)
  • image: Search image (default: )
  • background: Background color of search widget, in hexadecimal notation #rrggbb (default: #f9f9f9)
  • Parameters passed to <inputbox>:
    • type: search|fulltext (default: fulltext)
      • search: Show additional button for exact match search
      • fulltext: Show Full text search button only
    • buttonlabel: Title of 'Exact match' button (default: "Search this book")
    • searchbuttonlabel: Title of 'Full text' button (default: "Search this book")
    • break: no|yes (default: yes)
      • no: Search button(s) appear to right of input field
      • yes: Search button(s) appear centered below input field
    • prefix: Search scope (default: BOOKNAME)
    • width: Width of input field in pixels (automatically converted to number of characters) (default: 250)
    • placeholder: Define placeholder text displayed in the input field when empty (default "")

Examples[sửa]

Wikitext Display
{{Book search|float=right|style=simple}}
{{Book search|float=center|style=image}}

TemplateData[sửa]

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 Tìm kiếm sách

Display input box for searching book contents

Tham số bản mẫu[Quản lý Dữ liệu bản mẫu]

Nên dùng bản mẫu này với các tham số đặt trên cùng một hàng.

Tham sốMiêu tảKiểuTrạng thái
Page placementfloat

Set search field page alignment

Giá trị đề nghị
left center right
Mặc định
right
Ví dụ
left
Chuỗi ngắnkhuyên dùng
CSS classesclass

Define additional CSS classes for bounding box

Chuỗi ngắntùy chọn
Appearancestyle

Select one of two available visual styles for search field

Giá trị đề nghị
simple image
Mặc định
simple
Ví dụ
image
Chuỗi ngắnbắt buộc
Bounding box widthpx

Define total width of template output

Mặc định
250px
Ví dụ
350px
Chuỗi ngắntùy chọn
Search imageimage

Image displayed alongside input field to signify purpose (see 'Magnifying glass on book icons' category at Wikimedia Commons for suitable options)

Mặc định
Loupe light.svg
Ví dụ
BookReader-favicon.svg
Tập tintùy chọn
Widget background colorbackground

A solid color to serve as the background for the entire search widget, given in hexadecimal notation as #rrggbb

Mặc định
#f9f9f9
Ví dụ
#d73f09
Chuỗi ngắntùy chọn
Search modes offeredtype

Selection between a widget offering full text search only, or both full text and exact match searches

Giá trị đề nghị
fulltext search
Mặc định
fulltext
Ví dụ
search
Chuỗi ngắntùy chọn
Exact match buttonbuttonlabel

Overrides the default label for the 'Exact match' button ("Search this book") with the value supplied

Giá trị đề nghị
Exact match I'm feeling lucky
Mặc định
Search this book
Ví dụ
I'm feeling lucky
Chuỗi ngắntùy chọn
Full text buttonsearchbuttonlabel

Overrides the default label for the 'Full text search' button ("Search this book") with the value supplied

Giá trị đề nghị
Full text search Recursive search Thorough search
Mặc định
Search this book
Ví dụ
Deep search
Chuỗi ngắntùy chọn
Button placementbreak

Selects between placing search button(s) to the right of input field or centered beneath

Mặc định
yes
Ví dụ
no
Giá trị tự động
no
Luận lýtùy chọn
Search scopeprefix

Defines the point in the Wikibooks index from which to search recursively

Mặc định
{{BOOKNAME}}
Giá trị tự động
Tên trangtùy chọn
Input field widthwidth

Width of search input field in pixels

Mặc định
250
Ví dụ
350
Sốtùy chọn
Placeholder textplaceholder

Text shown faded in input field when empty

Ví dụ
Search terms here
Chuỗi ngắntùy chọn

See also[sửa]