Jump to content

Template:Search link: Difference between revisions

From Fifth Empire Wiki
m added a comment. feel free to indent/comment to your liking
Indenting the code. Adding to fist comment ". do work", and last comment ", show syntax". No change in code logic, all looks fine.
Line 1: Line 1:
{{#if:{{{1|}}}| <!-- if the first parameter exists -->
{{#if:{{{1|}}}
<span class="plainlinks">[{{fullurl:Special:Search|search={{
| <!-- if the first parameter exists, do work -->
  urlencode:{{{1|}}}}}{{
  <span class="plainlinks">[{{fullurl:Special:Search|search={{
  #if:{{{ns|}}}  <!-- ns = all / ns0=1&ns5=1 -->
    urlencode:{{{1|}}}}}{{
  | {{#ifeq: {{{ns|}}} | all
    #if:{{{ns|}}}  <!-- ns = all / ns0=1&ns5=1 -->
    | &ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1<!--
    | {{#ifeq: {{{ns|}}} | all
      -->&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1
      | &ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1<!--
    | &{{lc:{{{ns|}}}}}  <!-- Use {{lc:}} also to strip away whitespace -->
        -->&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1
    }}
      | &{{lc:{{{ns|}}}}}  <!-- Use {{lc:}} also to strip away whitespace -->
  }}{{
      }}
  #if:{{{3|}}}  <!-- 3 = ns0 (or any other nsX) -->
    }}{{
  | &{{lc:{{{3|}}}}}=1  
    #if:{{{3|}}}  <!-- 3 = ns0 (or any other nsX) -->
  }}{{
    | &{{lc:{{{3|}}}}}=1  
  #if:{{{4|}}}| &{{lc:{{{4|}}}}}=1  
    }}{{
  }}{{
    #if:{{{4|}}}| &{{lc:{{{4|}}}}}=1  
  #if:{{{5|}}}| &{{lc:{{{5|}}}}}=1  
    }}{{
  }}{{
    #if:{{{5|}}}| &{{lc:{{{5|}}}}}=1  
  #if:{{{6|}}}| &{{lc:{{{6|}}}}}=1  
    }}{{
  }}{{
    #if:{{{6|}}}| &{{lc:{{{6|}}}}}=1  
  #if:{{{7|}}}| &{{lc:{{{7|}}}}}=1  
    }}{{
  }}{{
    #if:{{{7|}}}| &{{lc:{{{7|}}}}}=1  
  #if:{{{8|}}}| &{{lc:{{{8|}}}}}=1  
    }}{{
  }}{{
    #if:{{{8|}}}| &{{lc:{{{8|}}}}}=1  
  #if:{{{9|}}}| &{{lc:{{{9|}}}}}=1  
    }}{{
  }}{{
    #if:{{{9|}}}| &{{lc:{{{9|}}}}}=1  
  #if:{{{10|}}}| &{{lc:{{{10|}}}}}=1  
    }}{{
  }}{{
    #if:{{{10|}}}| &{{lc:{{{10|}}}}}=1  
  #if:{{{11|}}}| &{{lc:{{{11|}}}}}=1  
    }}{{
  }}{{
    #if:{{{11|}}}| &{{lc:{{{11|}}}}}=1  
  #if:{{{12|}}}| &{{lc:{{{12|}}}}}=1  
    }}{{
  }}{{
    #if:{{{12|}}}| &{{lc:{{{12|}}}}}=1  
  #if:{{{13|}}}| &{{lc:{{{13|}}}}}=1  
    }}{{
  }}{{
    #if:{{{13|}}}| &{{lc:{{{13|}}}}}=1  
  #if:{{{14|}}}| &{{lc:{{{14|}}}}}=1  
    }}{{
  }}{{
    #if:{{{14|}}}| &{{lc:{{{14|}}}}}=1  
  #if:{{{15|}}}| &{{lc:{{{15|}}}}}=1  
    }}{{
  }}{{
    #if:{{{15|}}}| &{{lc:{{{15|}}}}}=1  
  #if:{{{16|}}}| &{{lc:{{{16|}}}}}=1  
    }}{{
  }}{{
    #if:{{{16|}}}| &{{lc:{{{16|}}}}}=1  
  #if:{{{17|}}}| &{{lc:{{{17|}}}}}=1  
    }}{{
  }}{{
    #if:{{{17|}}}| &{{lc:{{{17|}}}}}=1  
  #if:{{{18|}}}| &{{lc:{{{18|}}}}}=1  
    }}{{
  }}{{
    #if:{{{18|}}}| &{{lc:{{{18|}}}}}=1  
  #if:{{{19|}}}| &{{lc:{{{19|}}}}}=1  
    }}{{
  }}{{
    #if:{{{19|}}}| &{{lc:{{{19|}}}}}=1  
  #if:{{{20|}}}| &{{lc:{{{20|}}}}}=1  
    }}{{
  }}&fulltext=Search
    #if:{{{20|}}}| &{{lc:{{{20|}}}}}=1  
}} {{{2|search}}}]</span>
    }}&fulltext=Search
|<!-- if the first parameter does not exist -->
  }} {{{2|search}}}]</span>
<code><nowiki>{{search link|search string|link text}}</nowiki></code>}}<noinclude>
| <!-- if the first parameter does not exist, show syntax -->
  <code><nowiki>{{search link|search string|link text}}</nowiki></code>
}}<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>

Revision as of 01:53, 23 April 2009

{{search link|search string|link text}}