Jump to content

Template:Search link: Difference between revisions

From Fifth Empire Wiki
Add back in deprecated parameter names for special users, while retaining the new parameter names that match the new family of search link templates
m 46 revisions imported from wikipedia:Template:Search_link
 
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{main other
<span class="plainlinks">[{{fullurl:Special:Search|search=<!--
| 1={{Warning|{{tl|Search link}} should not be used in [[WP:WIAA|articles]] as links to "search result pages" are among the [[WP:LINKSTOAVOID|links normally to be avoided]].}}
| 2=<span class="plainlinks">[{{fullurl:Special:Search|search=<!--
     -->{{urlencode:{{{query|{{{text|{{{1|}}}}}}}}}}}<!--  Given query  
     -->{{urlencode:{{{query|{{{text|{{{1|}}}}}}}}}}}<!--  Given query  
     -->{{#if:{{{ns|}}}  <!-- ns = all / ns0=1&ns5=1 -->
     -->{{#if:{{{limit|}}}|&limit={{{limit|}}}}}<!--
    | {{#ifeq: {{{ns}}} | all
    -->{{#if:{{{ns|}}} {{{3|}}} {{{4|}}} {{{5|}}} {{{6|}}} {{{7|}}} {{{8|}}} {{{9|}}}{{{10|}}} {{{11|}}} {{{12|}}} {{{13|}}} {{{14|}}} {{{15|}}} {{{16|}}} {{{17|}}} {{{18|}}} {{{19|}}} {{{20|}}}
      | &ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1<!--
      |  <!-- either ns or 3-20 has a value set-->
        -->&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1
        {{#if:{{{ns|}}}  <!-- is ns set? -->
      | &{{lc:{{{ns|}}}}}  <!-- Use {{lc:}} also to strip away whitespace -->
        | {{#ifeq: {{{ns}}} | all   <!-- ns is set. Is the value "all"?
      }}
          -->| <!-- True, the value of ns is "all" -->
    }}{{
          &ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1<!--
    #if:{{{3|}}}  <!-- 3 = ns0 (or any other nsX) -->
          -->&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1<!--
    | &{{lc:{{{3|}}}}}=1  
          -->&ns118=1&ns119=1&ns710=1&ns711=1&ns828=1&ns829=1
    }}{{
          | <!-- ns is set, but the value is not "all" -->
    #if:{{{4|}}}| &{{lc:{{{4|}}}}}=1  
          &{{lc:{{{ns}}}}}  <!-- You saw the & added, and ns argument:
    }}{{
                                ns=ns5 gives &ns5=1
    #if:{{{5|}}}| &{{lc:{{{5|}}}}}=1  
                                Use {{lc:}} not only to lower case,
    }}{{
                                but also to strip away whitespace -->
    #if:{{{6|}}}| &{{lc:{{{6|}}}}}=1  
        }}
    }}{{
        }}{{
    #if:{{{7|}}}| &{{lc:{{{7|}}}}}=1  
        #if:{{{3|}}}  <!-- positional parameter 3 = "ns0" or other nsX -->
    }}{{
        | &{{lc:{{{3|}}}}}=1  
    #if:{{{8|}}}| &{{lc:{{{8|}}}}}=1  
        }}{{
    }}{{
        #if:{{{4|}}}| &{{lc:{{{4|}}}}}=1  
    #if:{{{9|}}}| &{{lc:{{{9|}}}}}=1  
        }}{{
    }}{{
        #if:{{{5|}}}| &{{lc:{{{5|}}}}}=1  
    #if:{{{10|}}}| &{{lc:{{{10|}}}}}=1  
        }}{{
    }}{{
        #if:{{{6|}}}| &{{lc:{{{6|}}}}}=1  
    #if:{{{11|}}}| &{{lc:{{{11|}}}}}=1  
        }}{{
    }}{{
        #if:{{{7|}}}| &{{lc:{{{7|}}}}}=1  
    #if:{{{12|}}}| &{{lc:{{{12|}}}}}=1  
        }}{{
    }}{{
        #if:{{{8|}}}| &{{lc:{{{8|}}}}}=1  
    #if:{{{13|}}}| &{{lc:{{{13|}}}}}=1  
        }}{{
    }}{{
        #if:{{{9|}}}| &{{lc:{{{9|}}}}}=1  
    #if:{{{14|}}}| &{{lc:{{{14|}}}}}=1  
        }}{{
    }}{{
        #if:{{{10|}}}| &{{lc:{{{10|}}}}}=1  
    #if:{{{15|}}}| &{{lc:{{{15|}}}}}=1  
        }}{{
    }}{{
        #if:{{{11|}}}| &{{lc:{{{11|}}}}}=1  
    #if:{{{16|}}}| &{{lc:{{{16|}}}}}=1  
        }}{{
    }}{{
        #if:{{{12|}}}| &{{lc:{{{12|}}}}}=1  
    #if:{{{17|}}}| &{{lc:{{{17|}}}}}=1  
        }}{{
    }}{{
        #if:{{{13|}}}| &{{lc:{{{13|}}}}}=1  
    #if:{{{18|}}}| &{{lc:{{{18|}}}}}=1  
        }}{{
    }}{{
        #if:{{{14|}}}| &{{lc:{{{14|}}}}}=1  
    #if:{{{19|}}}| &{{lc:{{{19|}}}}}=1  
        }}{{
    }}{{
        #if:{{{15|}}}| &{{lc:{{{15|}}}}}=1  
    #if:{{{20|}}}| &{{lc:{{{20|}}}}}=1  
        }}{{
    }}&fulltext=Search
        #if:{{{16|}}}| &{{lc:{{{16|}}}}}=1  
  }}<!-- Done with [URL part.  Now for the name] part of [URL name].
        }}{{
  (The URL part already escapes square brackets [ ], in urlencode %5B %5D.)
        #if:{{{17|}}}| &{{lc:{{{17|}}}}}=1  
        }}{{
        #if:{{{18|}}}| &{{lc:{{{18|}}}}}=1  
        }}{{
        #if:{{{19|}}}| &{{lc:{{{19|}}}}}=1  
        }}{{
        #if:{{{20|}}}| &{{lc:{{{20|}}}}}=1  
        }}
      |&ns0=1<!-- Neither ns nor 3-20 were set.
        So made Template Search link's default search domain
        equal to article space;
        otherwise user account can set it to "all" by default
        at their own [[Special:Search]] Advanced
    -->}}&fulltext=Search<!-- does what "~" does when first character of query
   
    Done with [URL part.   
    Now for the name] part of [URL name].
    (The URL part already escapes square brackets [ ], in urlencode %5B %5D.)
  -->}}<!--


   You'll see the space.  The "replace" wrappers escape square brackets in name.
   You'll see the space.  The "replace" wrappers escape square brackets in name.
Line 61: Line 77:
   -->|]|&#93;}}<!-- ] with its html symbol
   -->|]|&#93;}}<!-- ] with its html symbol
    
    
   -->]</span>
   -->]</span><!--
}}<!-- End of template main
Output a hidden category: -->{{#if: {{{ns|}}}{{{3|}}}{{{4|}}}{{{5|}}}{{{6|}}}{{{7|}}}{{{8|}}}{{{9|}}}{{{10|}}}{{{11|}}}{{{12|}}}{{{13|}}}{{{14|}}}{{{15|}}}{{{16|}}}{{{17|}}}{{{18|}}}{{{19|}}}{{{20|}}}
Output a hidden category: -->{{#if: {{{ns|}}}{{{3|}}}{{{4|}}}{{{5|}}}{{{6|}}}{{{7|}}}{{{8|}}}{{{9|}}}{{{10|}}}{{{11|}}}{{{12|}}}{{{13|}}}{{{14|}}}{{{15|}}}{{{16|}}}{{{17|}}}{{{18|}}}{{{19|}}}{{{20|}}}
  | [[Category:Search link templates with namespace parameters]]
  | [[Category:Search link templates with namespace parameters]]

Latest revision as of 20:49, 24 January 2026