Difference between revisions of "Template:Search link"
m (Edit) |
RealRecipes (talk | contribs) m (1 revision) |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 6: | Line 6: | ||
| {{#ifeq: {{{ns|}}} | all | | {{#ifeq: {{{ns|}}} | all | ||
| &ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1<!-- | | &ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1<!-- | ||
| − | -->&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1& | + | -->&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns102=1&ns103=1<!-- |
| + | -->&ns108=1&ns109=1&ns110=1&ns111=1&ns112=1&ns113=1 | ||
| &{{lc:{{{ns|}}}}} <!-- Use {{lc:}} also to strip away whitespace --> | | &{{lc:{{{ns|}}}}} <!-- Use {{lc:}} also to strip away whitespace --> | ||
}} | }} | ||
| Line 50: | Line 51: | ||
| <!-- if the first parameter does not exist, show syntax --> | | <!-- if the first parameter does not exist, show syntax --> | ||
<code><nowiki>{{search link|search string|link text}}</nowiki></code> | <code><nowiki>{{search link|search string|link text}}</nowiki></code> | ||
| − | |||
| − | |||
| − | |||
}}<noinclude> | }}<noinclude> | ||
| − | |||
{{documentation}} | {{documentation}} | ||
<!-- Add categories and interwikis to the /doc subpage, not here! --> | <!-- Add categories and interwikis to the /doc subpage, not here! --> | ||
</noinclude> | </noinclude> | ||
Latest revision as of 16:33, 25 March 2012
{{search link|search string|link text}}
This is the {{search link}} template.
It creates a link to the Wikibooks search.
Usage
| Wikibooks namespaces | |||
|---|---|---|---|
| Basic namespaces | Talk namespaces | ||
| 0 | Main | Talk | 1 |
| 2 | User | User talk | 3 |
| 4 | Wikibooks | Wikibooks talk | 5 |
| 6 | File | File talk | 7 |
| 8 | MediaWiki | MediaWiki talk | 9 |
| 10 | Template | Template talk | 11 |
| 12 | Help | Help talk | 13 |
| 14 | Category | Category talk | 15 |
| 102 | Cookbook | Cookbook talk | 103 |
| 108 | Transwiki | Transwiki talk | 109 |
| 110 | Wikijunior | Wikijunior talk | 111 |
| 112 | Subject | Subject talk | 113 |
| Virtual namespaces | |||
| -1 | Special | ||
| -2 | Media | ||
This template takes one or more parameters. The first unnamed parameter is the word or phrase to search for. The second unnamed parameter is the caption for the link.
Here are some examples. Code to the left and actual rendering to the right:
{{search link|search string}}= search string
{{search link|search string|link text}}= link text
When doing a basic search like that Wikibooks only searches the namespaces that the user has set in "My preferences - Search - Namespaces". If you want to specify what namespaces the search will use, then this template has several ways to do that.
To search all namespaces:
{{search link|search string|ns=all}}= search string{{search link|search string|link text|ns=all}}= link text
To specify some namespaces, for instance mainspace and its talk space (ns0 and ns1):
{{search link|search string||ns0|ns1}}= search string{{search link|search string|link text|ns0|ns1}}= link text
Note the empty link text parameter in the first example above. That is because the parameters are unnamed. If "ns0" were fed as the second parameter then it would become the link text, not the first namespace to search.
See also
- {{search box}} - unrestricted search of any subset of any namespace
| The above documentation is transcluded from Template:Search link/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |