Extension:SearchBox

From MediaWiki.org

Jump to: navigation, search

           

Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
SearchBox

Release status: beta

Implementation  Tag
Description Allow inclusion of search forms
Author(s)  Trevor ParscalTalk
Last Version  SVN (2008-10-28)
MediaWiki  1.8 and higher
License GPL v2
Download Download snapshot

Subversion [Help]
Browse source code

check usage (experimental)

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

[edit] User Interface

[edit] Adding a SearchBox

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

[edit] Installation

  • Copy the SearchBox folder into your extensions directory.
  • Add the line require_once "{$IP}/extensions/SearchBox/SearchBox.php"; to LocalSettings.php
  • Add a <searchbox /> tag to any page you wish to use the extension on.

[edit] Parameters

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.

[edit] Label

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

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

[edit] SearchLabel

Applied as the value of the search button

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

[edit] GoLabel

Applied as the value of the go button

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

[edit] Hide

A list of elements to hide

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

[edit] NamespacesLabel

Inserted before the list of namespace checkboxes

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

[edit] Namespaces

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

[edit] Align

Applied to the entire box

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

[edit] Style

CSS applied to the entire box

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

[edit] Default

Applied as the value of the text input box

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

[edit] Size

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

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

[edit] Width

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

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

[edit] Spacing

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

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