I have found several extensions for MediaWiki which allow you put a Google search box for searching the web on your MediaWiki site. However, none of them seem to have an option to enable suggest, which populates a drop down menu of possible search terms based on what the user has typed in so far. How can I do this?
I posted this to Stackoverflow, because the solution will most likely require programming.
FYI, the existing extensions I found are:
– http://www.mediawiki.org/wiki/Extension:GoogleSiteSearch
– http://www.mediawiki.org/wiki/Extension:Google
First you need to add a new file to your mediawiki installation. Just call it googleSuggest.php. You need this file because of cross-domain issues with browser web security (you can thank the browser developers)
Add the following code to it:
Then you will need to download jquery from jQuery.com
Then you will need to get this plugin:http://docs.jquery.com/UI/Autocomplete
Then you will need to edit the head section. Add the following lines.
Then, where you want the web search: