Open main menu

Extension:SearchBox

MediaWiki extensions manual
OOjs UI icon advanced.svg
SearchBox
Release status: unmaintained
Implementation Tag
Description Allow inclusion of search forms
Author(s) Trevor Parscaltalk
Latest version SVN (2008-10-28)
MediaWiki 1.8+
License GPL v2
Download Template:WikimediaDownload/svn
Hooks used
ParserFirstCallInit
Translate the SearchBox extension if it is available at translatewiki.net
Check usage and version matrix.

This tag extension provides a way to add a search box to a page. This extension is intended to provide more functionality for people who are currently using the InputBox extension as a search box.

Contents

User InterfaceEdit

Adding a SearchBoxEdit

To add a SearchBox to a page, place a <searchbox /> tag to the page. Using XML style attributes, you can configure the SearchBox using many parameters

InstallationEdit

  • Copy the SearchBox folder into your extensions directory.
  • Add the line require_once "{$IP}/extensions/SearchBox/SearchBox.php"; to LocalSettings.php.
    $IP stands for the Installation Path (or "directory") of your MediaWiki installation, the same directory that holds LocalSettings.php, index.php etc..
  • Add a <searchbox /> tag to any page you wish to use the extension on.

ParametersEdit

This extension is configurable using XML style attributes, like so...

<searchbox
    label="Search this wiki for:"
    searchlabel="Find it..."
    golabel="Go!"
/>

The following parameters may be set to customize your search box.

LabelEdit

Inserted before the text input box. This parameter is passed through the wiki text parser.

* default:	
* format:	string
* example:	'Search this wiki for:'

SearchLabelEdit

Applied as the value of the search button

* default:	internationalized message
* format:	string
* example:	'Find It!'

GoLabelEdit

Applied as the value of the go button

* default:	internationalized message
* format:	string
* example:	'Go!'

HideEdit

A list of elements to hide

* default:	
* format:	List of comma delimited names: input | go | search | namespaces
* example:	'go'

NamespacesLabelEdit

Inserted before the list of namespace checkboxes

* default:	internationalized message
* format:	string
* example:	'Namespaces to search:'

NamespacesEdit

If there is more than 1 valid namespace in this list, a list of checkboxes will be inserted after the text input box and before the search button, in place of the go button. This parameter is passed through the wiki text parser.

* default:	
* format: 	List of comma delimited names, items with ** in them are check by default
* example:	'**Main,Special,User**'

AlignEdit

Applied to the entire box

* default:	'center'
* format:	'left' | 'center' | 'right'
* example:	'left'

StyleEdit

CSS applied to the entire box

* default:	
* format:	inline CSS
* example:	'border:1px solid red;'

DefaultEdit

Applied as the value of the text input box

* default:	
* format:	string
* example:	'something in particular'

SizeEdit

Applied as the width (in characters) of the text input box

* default:	50
* format:	integer
* example:	20

WidthEdit

Applied as the width (in pixels) of the text input box

* default:	'auto'
* format:	integer | 'auto'
* example:	25

SpacingEdit

Applied to all controls in the box as amount of space (in pixels) between them

* default:	5
* format:	integer
* example:	10