Extension:SearchBox

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
SearchBox

Release status:Extension status unmaintained

ImplementationTemplate:Extension#type Tag
DescriptionTemplate:Extension#description Allow inclusion of search forms
Author(s)Template:Extension#username Trevor Parscaltalk
Latest versionTemplate:Extension#version SVN (2008-10-28)
MediaWikiTemplate:Extension#mediawiki 1.8 and higher
LicenseTemplate:Extension#license GPL v2
Download Template:WikimediaDownload/svn
Hooks usedTemplate:Extension#hook
ParserFirstCallInitManual:Hooks/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.

User Interface[edit]

Adding a SearchBox[edit]

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

Installation[edit]

  • 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.

Parameters[edit]

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.

Label[edit]

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

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

SearchLabel[edit]

Applied as the value of the search button

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

GoLabel[edit]

Applied as the value of the go button

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

Hide[edit]

A list of elements to hide

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

NamespacesLabel[edit]

Inserted before the list of namespace checkboxes

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

Namespaces[edit]

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**'

Align[edit]

Applied to the entire box

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

Style[edit]

CSS applied to the entire box

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

Default[edit]

Applied as the value of the text input box

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

Size[edit]

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

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

Width[edit]

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

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

Spacing[edit]

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

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