Help:DPL Examples/Test resultsheader

From Terraria Wiki
Jump to navigation Jump to search

Amb%

98 pages found.

Amc%

no page found.

Amm%

22 pages 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 'Att' are there in this wiki?===
 resultsfooter= ===There are %PAGES% articles starting with 'Att' in this wiki.===

Some text before the query:

How many articles starting with 'Att' are there in this wiki?======There are 9 articles starting with 'Att' 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 'Att' are there in this wiki?===\n
 resultsfooter= \n===There are %PAGES% articles starting with 'Att' in this wiki.===\n

Some text before the query:

How many articles starting with 'Att' are there in this wiki?

There are 9 articles starting with 'Att' in this wiki.

and some text after the query.


On the other hand you can write something like

* [[:Category:Terraria Wiki|Terraria Wiki]] {{#dpl:category=Terraria Wiki|resultsheader=(%PAGES%)|format=,}} ...
** [[:Category:Guides|Guides]] {{#dpl:category=Guides|resultsheader=(%PAGES%)|format=,}} ...
** [[:Category:Help|Help]] {{#dpl:category=Help|resultsheader=(%PAGES%)|format=,}} ...

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:

* {{Help:DPL Manual/Category with count|Terraria Wiki}} ...
** {{Help:DPL Manual/Category with count|Guides}} ...
** {{Help:DPL Manual/Category with count|Help}} ...

and would produce the same result: