Template:Search
(Redirected from InlineSearch)
This template is a template gadget. It requires the InlineSearch gadget to work, which is loaded automatically when this template is used. |
Use this template to search the wiki and display the results in a wiki page.
See the installation instructions to get it working in your wiki.
Usage
editBasic
editMarkup | Renders as |
---|---|
|
Searching...
|
Advanced
editMarkup | Renders as |
---|---|
|
Searching...
|
Installation
editTo install this template in your wiki:
- Create a template with the following markup. You can choose the template name, parameter names and defaults to suit your wiki.
<includeonly><div class="InlineSearch" data-search="{{{1|{{{query|}}}}}}" data-namespace="{{{namespace|}}}" data-limit="{{{limit|}}}" data-sort="{{{sort|}}}" >Searching...</div>[[Category:Gadget:InlineSearch]]</includeonly>
- Create MediaWiki:Gadget-InlineSearch.js with the following code:
/** * InlineSearch allows to search the wiki and display the results in a wiki page * Documentation: https://www.mediawiki.org/wiki/InlineSearch * Source code: https://www.mediawiki.org/wiki/MediaWiki:Gadget-Global-InlineSearch.js */ mw.loader.load( '//www.mediawiki.org/w/load.php?modules=ext.gadget.Global-InlineSearch' );
- Add the following gadget to MediaWiki:Gadgets-definition:
* InlineSearch[ResourceLoader|hidden|default|categories=Gadget:InlineSearch]|InlineSearch.js
Done! Add your template to any page to verify that the installation was successful.
Template data
editUse this template to search the wiki and display the results inline
Parameter | Description | Type | Status | |
---|---|---|---|---|
Query | query 1 | Search terms or query | String | required |
Namespace | namespace | Namespace number to search
| Number | optional |
Limit | limit | Max search results to show
| Number | optional |
Sort | sort | Sort criteria for search results
| String | optional |
See also
edit- es:Plantilla:Buscar - Spanish localization of this template
- User:Sophivorus - Main author of this template