Template:Search box

From Wikimedia Commons, the free media repository
Jump to: navigation, search
Documentation icon Documentation[view] [edit] [history] [purge]

This documentation is transcluded from Template:Search box/doc.



The {{search box}} template may be used to add an input box to let the user search a set of pages, for example archived Talk pages.

Usage[edit]

{{search box
 |root= 
 |search-break=<yes|no>
 |search-width=number
 |search-button-label= 
}}

or, to omit the final "/" from the search prefix:

{{search box
 |root= 
 |nosuffix=anything
 |search-break=<yes|no>
 |search-width=number
 |search-button-label= 
}}

Parameters[edit]

root
|root=User talk:Example/Archives will search in pages starting with User talk:Example/Archives. The default is the current page name folllowed by "/".
nosuffix
|nosuffix= will omit the final "/" to allow search in all pages starting with root. Note that "|nosuffix" will be ignored.
search-break
search-break=yes will insert a break between the search bar and search button. The default is no.
search-width
can be used to change the width of the text field, in characters. The default is 22, which fits the search bar with the default box width. Note: this is a bare number with no units.
search-button-label
can be used to change the text on the search button. The default is "Search".

Examples[edit]

{{search box
 |root= User:84user
 |search-break=no
 |search-width=22
 |search-button-label=Search User:84user with suffix
}}

produces


{{search box
 |root= User:84user
 |nosuffix
 |search-break=no
 |search-width=22
 |search-button-label=Search User:84user with nosuffix ignored
}}

produces


{{search box
 |root= User:84user
 |search-break=no
 |search-width=22
 |search-button-label=Search User:84user with suffix
}}

produces


{{search box
 |root= User:84user
 |nosuffix=
 |search-break=no
 |search-width=22
 |search-button-label=Search User:84user with no suffix
}}

produces


{{search box
 |root= User:84user
 |nosuffix=anything
 |search-break=no
 |search-width=22
 |search-button-label=Search User:84user with no suffix=anything
}}

produces


Wrap the template call in a table to workaround the formatting (see source for details):

See also[edit]