Template:DPL/0

From Wikibooks, open books for an open world
Jump to: navigation, search
[edit] [history] [purge] Template documentation

This is one of a series of subtemplates of {{DPL}} that display increments of a long list of pages.

Usage

In addition to the parameters accepted by {{DPL}}, this subtemplate also accepts three other parameters.

  • {{{ping}}} — Optional. If non-blank, this subtemplate is only being called to make sure it exists.
  • {{{increment}}} — Required. An integer number of pages to be listed by each subtemplate in the series.
  • {{{n}}} Required. An integer that names this subtemplate. The first subtemplate in the series is called 0, the second is 1, and so on.

If {{{ping}}} is non-blank, this subtemplate simply returns "ping" without doing anything else. This makes it possible for each subtemplate in the series to look for the next subtemplate in the series without using expensive parser function {{#ifexist:}} (instead, simply ping the next subtemplate and compare the result to "ping").

Otherwise, this subtemplate first uses subtemplate {{DPL/simple}} to display up to {{{increment}}} pages of the list, and then calls the next subtemplate to display any remaining pages up to {{{count}}}.

The identity of the next subtemplate is determined via {{DPL/name next}}, which detects when there are no more subtemplates available in the series and in that case diverts the call to {{DPL/simple}}.

Of the parameters to {{DPL}}, {{{count}}} is required by this subtemplate; if {{DPL}} is not provided a value for this parameter, it calls {{DPL/simple}} directly, bypassing the numbered series of subtemplates. {{{count}}} and {{{offset}}} are adjusted by each numbered subtemplate when it calls the next subtemplate. {{{showerror}}} is passed from {{DPL}} to {{DPL/0}}, and is passed from each numbered subtemplate in its initial call to {{DPL/simple}}, but is nulled when calling the next subtemplate — so that if non-null showerror is passed to {{DPL}}, it is only passed on to the first call to {{DPL/simple}}.

Extending the series

To extend the series, check Special:PrefixIndex/Template:DPL/ to see what the next numbered subtemplate would be, and create that template with exactly the same content as all the preceding numbered subtemplates.
http://en.wikibooks.org/wiki/Template:DPL/0
en.wikibooks.org
crawl=CC-MAIN-2013-48
26002
application/http; msgtype=response
sha1:RFYQKTDSELZPEYS5A5QTQOCYXUGVVVYF
<urn:uuid:793ccc8d-925c-4a9e-81a5-96afd41cfd92>
2013-12-06T17:41:15Z
208.80.154.228
sha1:ILI6VTUIOSCESDYRLGHMXXGCZ44DEM7O
<urn:uuid:fe849464-85e7-4431-bc15-047050fd9133>
http://en.wikibooks.org/wiki/Template:DPL/0
response
<urn:uuid:864afaed-dac5-4721-8acf-3adaf67b5313>
robots: classic
hostname: ip-10-33-133-15.ec2.internal
software: Nutch 1.6 (CC)/CC WarcExport 1.0
isPartOf: CC-MAIN-2013-48
operator: CommonCrawl Admin
description: Wide crawl of the web with URLs provided by Blekko for Winter 2013
publisher: CommonCrawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf