Template:Search: Difference between revisions

    From KDE UserBase Wiki
    (Created page with "<includeonly> <DPL> namespace = Main nottitleregexp = .*((/[a-z][a-z](.|-..)?)|([ _][(][a-z][a-z][)]))$ titlematch = A%|B%|C%|D%|E%|F%|G%|H%|I%|J% include = * includ...")
     
    (Corrected descriptive text)
    (18 intermediate revisions by the same user not shown)
    Line 1: Line 1:
    <includeonly>
    <includeonly>
    <DPL>
    {{#dpl:
       namespace = Main
       |namespace =  
       nottitleregexp = .*((/[a-z][a-z](.|-..)?)|([ _][(][a-z][a-z][)]))$
       |nottitleregexp = .*((/[a-z][a-z](.{{!}}-..)?){{!}}([ _][(][a-z][a-z][)]))$
       titlematch = A%|B%|C%|D%|E%|F%|G%|H%|I%|J%
       |titleregexp = ^[A-J]
       include = *
      |include = *
       includematch = ¤{{{1}}}¤
      |includematch = @{{{1}}}@
       includemaxlength = 0
      |includemaxlength = 0
       format = ,\n* [[%PAGE%|%TITLE%]],,
      |format = ,\n* [[%PAGE%{{!}}%TITLE%]],,
    </DPL>
    | resultsheader = There are %TOTALPAGES% pages beginning with A-J\n
    <DPL>
    }}
       namespace = Main
    {{#dpl:
       nottitleregexp = .*((/[a-z][a-z](.|-..)?)|([ _][(][a-z][a-z][)]))$
      |namespace =
       titlematch = K%
      |nottitleregexp = .*((/[a-z][a-z](.{{!}}-..)?){{!}}([ _][(][a-z][a-z][)]))$
       include = *
      |titleregexp = ^K[A-Z]
       includematch = ¤{{{1}}}¤
       |include = *
       includemaxlength = 0
       |includematch = @{{{1}}}@
       format = ,\n* [[%PAGE%|%TITLE%]],,
       |includemaxlength = 0
    </DPL>
       |format = ,\n* [[%PAGE%{{!}}%TITLE%]],,
    <DPL>
    | resultsheader = There are %TOTALPAGES% pages beginning with KA-KZ\n
       namespace = Main
    }}
       nottitleregexp = .*((/[a-z][a-z](.|-..)?)|([ _][(][a-z][a-z][)]))$
    {{#dpl:
       titlematch = L%|M%|N%|O%|P%|Q%|R%|S%|T%|U%|V%|W%|X%|Y%|Z%
       |namespace =  
       include = *
       |nottitleregexp = .*((/[a-z][a-z](.{{!}}-..)?){{!}}([ _][(][a-z][a-z][)]))$
       includematch = ¤{{{1}}}¤
       |titleregexp = ^K[a-ce-z]
       includemaxlength = 0
       |include = *
       format = ,\n* [[%PAGE%|%TITLE%]],,
       |includematch = @{{{1}}}@
    </DPL>
       |includemaxlength = 0
    </includeonly><noinclude>
       |format = ,\n* [[%PAGE%{{!}}%TITLE%]],,
    Find pages containing a string: <code><nowiki>{{Search|xyz}}</nowiki></code> finds all pages containing the string ''xyz''. Searches are case sensitive. In order to find both ''xyz'' and ''Xyz'' use a regular expression: <code><nowiki>{{Search|[Xx]yz}}</nowiki></code>.
    | resultsheader = There are %TOTALPAGES% pages beginning with Ka-Kz but not Kd\n
    }}
    {{#dpl:
       |namespace =  
       |nottitleregexp = .*((/[a-z][a-z](.{{!}}-..)?){{!}}([ _][(][a-z][a-z][)]))$
       |titleregexp = ^Kd
      |include = *
      |includematch = @{{{1}}}@
      |includemaxlength = 0
      |format = ,\n* [[%PAGE%{{!}}%TITLE%]],,
    | resultsheader = There are %TOTALPAGES% pages beginning with Kd\n
    }}
    {{#dpl:
      |namespace =
      |nottitleregexp = .*((/[a-z][a-z](.{{!}}-..)?){{!}}([ _][(][a-z][a-z][)]))$
      |titleregexp = ^[L-Z]
       |include = *
       |includematch = @{{{1}}}@
       |includemaxlength = 0
       |format = ,\n* [[%PAGE%{{!}}%TITLE%]],,
    | resultsheader = There are %TOTALPAGES% pages beginning with L-Z\n
    }}</includeonly><noinclude>
    Find pages containing a string: <code><nowiki>{{Search|</nowiki>'''''string'''''<nowiki>}}</nowiki></code> finds all pages containing the '''''string'''''. Searches are case sensitive. In order to find both ''xyz'' and ''Xyz'' use a regular expression: <code><nowiki>{{Search|[Xx]yz}}</nowiki></code>.


    Regular expressions use a perl like syntax. Special characters like '[', '[','(' and ')' need to be escaped.
    Regular expressions use a perl like syntax. Special characters like '[', '[','(' and ')' need to be escaped.


    No wiki expansion takes place before passing arguments to the template.
    No wiki expansion takes place before passing arguments to the template.
    {{Warning|1=Due to the limitations of the underlying database queries, the search is split in five parts, each searching less that 500 pages. To check that this limit is not exceeded, the number of pages in each search is also printed. Should one of the page counts exceed 500, some pages will have been ignored. The template then needs to be modified!}}
    Example: <code><nowiki>{{Search|1=Learn more}}</nowiki></code> gives
    {{Search|1=Learn more}}
    [[Category:Template]]
    [[Category:Template]]
    </noinclude>
    </noinclude>

    Revision as of 14:50, 19 January 2014

    Find pages containing a string: {{Search|string}} finds all pages containing the string. Searches are case sensitive. In order to find both xyz and Xyz use a regular expression: {{Search|[Xx]yz}}.

    Regular expressions use a perl like syntax. Special characters like '[', '[','(' and ')' need to be escaped.

    No wiki expansion takes place before passing arguments to the template.

    Warning

    Due to the limitations of the underlying database queries, the search is split in five parts, each searching less that 500 pages. To check that this limit is not exceeded, the number of pages in each search is also printed. Should one of the page counts exceed 500, some pages will have been ignored. The template then needs to be modified!


    Example: {{Search|1=Learn more}} gives

    There are 2019 pages beginning with A-J

    There are 1436 pages beginning with KA-KZ

    There are 1165 pages beginning with Ka-Kz but not Kd

    There are 388 pages beginning with Kd

    There are 2283 pages beginning with L-Z