DPL Example 013

From FollowTheScore
Revision as of 16:30, 9 May 2009 by Gero (talk | contribs) (New page: <pre><nowiki> {{#vardefine:count|10}}{{#vardefine:thispage|:DPL_Example_013}} {{#dpl: |namespace= |titlematch=C% |count={{#var:count}} |offset={{{offset|0}}} |resultsfooter= ²{#ife...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
{{#vardefine:count|10}}{{#vardefine:thispage|:DPL_Example_013}}
{{#dpl:
 |namespace=
 |titlematch=C%
 |count={{#var:count}}
 |offset={{{offset|0}}}
 |resultsfooter=
  ²{#ifexpr:%TOTALPAGES% > {{#var:count}}¦
\n-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --<br/>
  {{#ifexpr:{{{offset|0}}} > 0|
    [[Special:Call/{{#var:thispage}},offset={{#expr:{{{offset}}} - {{#var:count}}}}¦{{#expr:{{{offset}}} - {{#var:count}} + 1}}..{{{offset}}}]]  
  }}
  '''{{#expr:{{{offset|0}}} + 1}}..{{#expr:{{{offset|0}}} + {{#var:count}}}}'''  
  ²{#ifexpr:%TOTALPAGES% - {{#var:count}} > {{{offset|0}}}¦
    ²{#ifexpr:%TOTALPAGES% - 2 * {{#var:count}} <= {{{offset|0}}}¦
    [[Special:Call/{{#var:thispage}},offset={{#expr:{{{offset|0}}} + {{#var:count}}}}|{{#expr:{{{offset|0}}} + {{#var:count}} + 1}}..%TOTALPAGES%]]¦
    [[Special:Call/{{#var:thispage}},offset={{#expr:{{{offset|0}}} + {{#var:count}}}}|{{#expr:{{{offset|0}}} + {{#var:count}} + 1}}..{{#expr:{{{offset|0}}} + 2 * {{#var:count}}}}]]
    }²
  }²
    [[{{#var:thispage}}|reset]]     (total %TOTALPAGES%)
  }²
 |noresultsfooter=no more results<br/>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --<br/>
  ²{#ifexpr:{{{offset|0}}} > 0¦
  [[Special:Call/{{#var:thispage}},offset={{#expr:{{{offset}}} - {{#var:count}}}}¦{{#expr:{{{offset}}} - {{#var:count}} + 1}}..%TOTALPAGES%]]  }²
    [[{{#var:thispage}}|''reset'']]
}}

The code uses the variables extension and the Call extension and produces the following result:


{{#vardefine:count|10}}{{#vardefine:thispage|:DPL_Example_013}}

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option '{{#var:count}}' for parameter 'count'.

Expression error: Unrecognized punctuation character "{".