Difference between revisions of "Test resultsheader"
From FollowTheScore
								
												
				| (11 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | ==   | + | {{Type Test  | 
| + |  |parameter = resultsheader  | ||
| + | }}  | ||
| + | |||
| + | === Nige% ===  | ||
| + | {{#dpl:titlematch=Nige%  | ||
| + | |oneresultheader=one page found.  | ||
| + | |noresultsheader=no page found.  | ||
| + | |resultsheader=%PAGES% pages found.  | ||
| + | }}  | ||
| + | === Nigu% ===  | ||
| + | {{#dpl:titlematch=Nigu%  | ||
| + | |oneresultheader=one page found.  | ||
| + | |noresultsheader=no page found.  | ||
| + | |resultsheader=%PAGES% pages found.  | ||
| + | }}  | ||
| + | === Niga% ===  | ||
| + | {{#dpl:titlematch=Niga%  | ||
| + | |oneresultheader=one page found.  | ||
| + | |noresultsheader=no page found.  | ||
| + | |resultsheader=%PAGES% pages found.  | ||
| + | }}  | ||
| + | |||
| + | == Remarks ==  | ||
Note that theses statements do not automatically add newlines. Watch the problem with the DPL query below:  | Note that theses statements do not automatically add newlines. Watch the problem with the DPL query below:  | ||
| + |   resultsheader = ===How many articles starting with 'Af' are there in this wiki?===  | ||
| + |   resultsfooter= ===There are %PAGES% articles starting with 'Af' in this wiki.===  | ||
Some text before the query: <dpl>  | Some text before the query: <dpl>  | ||
| − |    resultsheader = ===How many articles starting with '  | + |    resultsheader = ===How many articles starting with 'Af' are there in this wiki?===  | 
   titlematch=Af%  |    titlematch=Af%  | ||
| − |    resultsfooter= ===There are %PAGES% articles starting with '  | + |    resultsfooter= ===There are %PAGES% articles starting with 'Af' in this wiki.===  | 
</dpl> and some text after the query.  | </dpl> and some text after the query.  | ||
| − | if we add \n the   | + | ----  | 
| + | if we add \n to the resultsheader and footer everything appears as wanted:  | ||
| + |   resultsheader = \n===How many articles starting with 'Af' are there in this wiki?===\n  | ||
| + |   resultsfooter= \n===There are %PAGES% articles starting with 'Af' in this wiki.===\n  | ||
Some text before the query: <dpl>  | Some text before the query: <dpl>  | ||
| − |    resultsheader = \n===How many articles starting with '  | + |    resultsheader = \n===How many articles starting with 'Af' are there in this wiki?===\n  | 
   titlematch=Af%  |    titlematch=Af%  | ||
| − |    resultsfooter= \n===There are %PAGES% articles starting with '  | + |    resultsfooter= \n===There are %PAGES% articles starting with 'Af' in this wiki.===\n  | 
</dpl> and some text after the query.  | </dpl> and some text after the query.  | ||
| + | ----  | ||
| + | |||
| + | On the other hand you can write something like  | ||
| + | |||
| + | <pre><nowiki>  | ||
| + | * [[:Category:DPL|DPL]] {{#dpl:category=DPL|resultsheader=(%PAGES%)|format=,}} ...  | ||
| + | ** [[:Category:DPL bugs|DPL bugs]] {{#dpl:category=DPL bugs|resultsheader=(%PAGES%)|format=,}} ...  | ||
| + | ** [[:Category:DPL Manual|DPL Manual]] {{#dpl:category=DPL Manual|resultsheader=(%PAGES%)|format=,}} ...  | ||
| + | </nowiki></pre>  | ||
| + | * [[:Category:DPL|DPL]] {{#dpl:category=DPL|resultsheader=(%PAGES%)|format=,}} ...  | ||
| + | ** [[:Category:DPL bugs|DPL bugs]] {{#dpl:category=DPL bugs|resultsheader=(%PAGES%)|format=,}} ...  | ||
| + | ** [[:Category:DPL Manual|DPL Manual]] {{#dpl:category=DPL Manual|resultsheader=(%PAGES%)|format=,}} ...  | ||
| + | |||
| + | This could be further improved by a [[Template:Category with count|template]] which produces a link to a category together with a member count.  | ||
| + | The source would the look like this:  | ||
| + | <pre><nowiki>  | ||
| + | * {{Category with count|DPL}} ...  | ||
| + | ** {{Category with count|DPL bugs}} ...  | ||
| + | ** {{Category with count|DPL Manual}} ...  | ||
| + | </nowiki></pre>  | ||
| + | and would produce the same result:  | ||
| + | * {{Category with count|DPL}} ...  | ||
| + | ** {{Category with count|DPL bugs}} ...  | ||
| + | ** {{Category with count|DPL Manual}} ...  | ||
[[Category:Test]]  | [[Category:Test]]  | ||
Latest revision as of 11:29, 28 January 2008
| Test | resultsheader | 
Nige%
one page found.Nigu%
2 pages found.Niga%
no page found.
Remarks
Note that theses statements do not automatically add newlines. Watch the problem with the DPL query below:
resultsheader = ===How many articles starting with 'Af' are there in this wiki?=== resultsfooter= ===There are %PAGES% articles starting with 'Af' in this wiki.===Some text before the query:
How many articles starting with 'Af' are there in this wiki?======There are 2 articles starting with 'Af' in this wiki.
and some text after the query.if we add \n to the resultsheader and footer everything appears as wanted:
resultsheader = \n===How many articles starting with 'Af' are there in this wiki?===\n resultsfooter= \n===There are %PAGES% articles starting with 'Af' in this wiki.===\n
Some text before the query:
How many articles starting with 'Af' are there in this wiki?
There are 2 articles starting with 'Af' in this wiki.
and some text after the query.On the other hand you can write something like
* [[:Category:DPL|DPL]] {{#dpl:category=DPL|resultsheader=(%PAGES%)|format=,}} ...
** [[:Category:DPL bugs|DPL bugs]] {{#dpl:category=DPL bugs|resultsheader=(%PAGES%)|format=,}} ...
** [[:Category:DPL Manual|DPL Manual]] {{#dpl:category=DPL Manual|resultsheader=(%PAGES%)|format=,}} ...
-  DPL (5) ...
- DPL bugs (1) ...
 - DPL Manual (18) ...
 
 
This could be further improved by a template which produces a link to a category together with a member count. The source would the look like this:
* {{Category with count|DPL}} ...
** {{Category with count|DPL bugs}} ...
** {{Category with count|DPL Manual}} ...
and would produce the same result:
-  DPL (5) ...
- DPL bugs (1) ...
 - DPL Manual (18) ...