Jump to content

Template:Template usage: Difference between revisions

From Fifth Empire Wiki
top: talk back
enable custom prefix parameter usage, remove template namespaces for now
Line 22: Line 22:
   -->{{{pattern}}}/<!--User part: the sub-pattern regexp, match within template.  
   -->{{{pattern}}}/<!--User part: the sub-pattern regexp, match within template.  
   And you see the ending / of the regexp/.   
   And you see the ending / of the regexp/.   
  Now add a filter to the search domain.  These are expensive searches.
-->}}<!-- end #if:pattern. No else part. Nothing to do if no pattern is given.
  Start with a space.
   There's always the hastemplate part, even if no insource:/regexp/ part.
-->}}<!-- end of #if: pattern, there's nothing to do if no pattern is given.
 
   There's only hastemplate part, but nothing to do for insource:/regexp/ part.
  There's also always another filter, usually prefix, but defaults to intitle.
   Always do the ''prefix:'' search parameter.  
   Always add a filter to the search domain to make the search less expensive.
   Never let all namespaces be searched at once because user defaults to that.
   Never let all namespaces be searched at once because user defaults to that.
   Purpose of this template: make inefficient searches fast via tests/limits.
   Purpose of this template: make inefficient searches fast via tests/limits.
--> prefix:{{#switch:{{{prefix}}}
  Start with a space.
|#default = {{FULLPAGENAME}}
--> {{#if:{{{prefix|}}} |
|n = {{NAMESPACE}}:
  {{#switch:{{{prefix}}}
|0|: = {{ns:0}}:
    |#default = prefix:{{{prefix}}}
|1 = {{ns:1}}:
    |n = prefix:{{NAMESPACE}}:
|2 = {{ns:2}}:
    |0|: = prefix:{{ns:0}}:
|3 = {{ns:3}}:
    |1 = prefix:{{ns:1}}:
|4 = {{ns:4}}:
    |2 = prefix:{{ns:2}}:
|5 = {{ns:5}}:
    |3 = prefix:{{ns:3}}:
|6 = {{ns:6}}:
    |4 = prefix:{{ns:4}}:
|7 = {{ns:7}}:
    |5 = prefix:{{ns:5}}:
|8 = {{ns:8}}:
    |6 = prefix:{{ns:6}}:
|9 = {{ns:9}}:
    |7 = prefix:{{ns:7}}:
|10 = {{ns:10}}:
    |8 = prefix:{{ns:8}}:
|11 = {{ns:11}}:
    |9 = prefix:{{ns:9}}:
|12 = {{ns:12}}:
    |10 = prefix:{{ns:10}}:
|13 = {{ns:13}}:
    |11 = prefix:{{ns:11}}:
|14 = {{ns:14}}:
    |12 = prefix:{{ns:12}}:
|15 = {{ns:15}}:
    |13 = prefix:{{ns:13}}:
|100 = {{ns:100}}:
    |14 = prefix:{{ns:14}}:
|101 = {{ns:101}}:
    |15 = prefix:{{ns:15}}:
|108 = {{ns:108}}:
    |100 = prefix:{{ns:100}}:
|109 = {{ns:109}}:
    |101 = prefix:{{ns:101}}:
|118 = {{ns:118}}:
    |108 = prefix:{{ns:108}}:
|119 = {{ns:119}}:
    |109 = prefix:{{ns:109}}:
}}}}}}</span> Perform a search {{#if:{{{pattern|}}}
    |118 = prefix:{{ns:118}}:
    |119 = prefix:{{ns:119}}:
  }}<!-- else if prefix not given, filter down to current page name
  -->| intitle:{{FULLPAGENAME}}}}}}</span> Perform a search {{#if:{{{pattern|}}}
| within all instances of | for }} template {{ucfirst: {{{template|val}}}}} ] <!--
| within all instances of | for }} template {{ucfirst: {{{template|val}}}}} ] <!--


Line 90: Line 93:
|119 = in the {{ns:119}} namespace.
|119 = in the {{ns:119}} namespace.
|#default = in all titles starting with the characters "{{{prefix}}}".
|#default = in all titles starting with the characters "{{{prefix}}}".
Or choose a [[H:S| prefix filter]] from: {{namespaces}}
}}</onlyinclude>
}}</onlyinclude>

Revision as of 20:25, 27 June 2015

Phase one of two: a test regexp /{{{pattern}}}/.[{{fullurl:Special:Search|search=hastemplate%3AVal++intitle%3ATemplate%3ATemplate+usage Perform a search for template Val ] on just this page.