Search box
This code creates a search box, identical to MediaWiki's "search" box that searches the specific MediaWiki project, which may be placed on personal webpages and be used to allow visitors to that webpage to search Wikimedia projects and wikis based on MediaWiki software. In this example, the box searches on Meta.
Code
[edit]Opens results in the same window:
<form action="http://meta.wikimedia.org/wiki/Special:Search"> <p><input type="text" value="" id="SearchInput" name="search"/><br> <input type="submit" value="Go" name="Go" id="searchGoButton"/> <input type="submit" value="Search" name="fulltext"/></p> </form>
Opens results in a new window:
<form action="http://meta.wikimedia.org/wiki/Special:Search" target="_blank"> <p><input type="text" value="" id="SearchInput" name="search"/><br> <input type="submit" value="Go" name="Go" id="searchGoButton"/> <input type="submit" value="Search" name="fulltext"/></p> </form>
Example
[edit]It looks like this:
Customisation
[edit]- If you want the search box to work for other Wikipedia or MediaWiki powered projects, replace the URL part of <form action="http://meta.wikimedia.org/"> with the URL of the project. Examples:
- For Wikipedia: http://en.wikipedia.org/
- For Wikisource: http://en.wikisource.org/
- For Wiktionary: http://en.wiktionary.org/
- For Wikibooks: http://en.wikibooks.org/
- For Wikinews: http://en.wikinews.org/
- For Wikimedia Commons: http://commons.wikimedia.org/
- For Wikiquote: http://en.wikiquote.org/
- For Wikispecies: http://species.wikipedia.org/
- For Wikimedia Foundation: http://wikimediafoundation.org/
- For different language Wikimedia projects, simply change the en part of the URL to the language code of that language