Issue:Request For %TOTALPAGES% Token
|Description:||Token that represents the total number of pages that match the DPL criteria.|
|Extension / Version:||DPL / 1.6.2|
|Type / Status:||Change Request / closed|
Since there is a limit on the number of pages returned, the token %PAGES% is never more than ExtDynamicPageList2::$maxResultCount, and there's no readily available mechanism for finding exactly how many pages exist that match the search criteria. I suggest adding the token %TOTALPAGES% to represent this value. Also, the %PAGES% token should be available in parameters other than the resultsheader and resultsfooter parameters. There's been times I've wanted to have output like:
1 of 26 2 of 26 ... 26 of 26
This is much harder to do than you might think. Only after all template matches (see includematch) have been evaluated we know the exact number of matches. This means that we would have to make an unlimited query just to get the correct number. A simple count(*) would not do (apart from the fact that the count(*) would require a SQL query for itself).
I recommend to write TWO DPL queries where the first one has an empty format clause. IN this DPL query the value of %PAGES% can be assigned to a local variable with #vardefine in the 'resultsfooter' clause. This variable can then be used in the second query at any place ... I know it´s not ideal but it should work.
Gero 21:47, 6 December 2007 (CET)