Examples/Parameter: scroll (example 1)
Example
This selects pages from Category:Fruit examples which has a number of results. The count
displays the first 3 articles, the offset
doesn't change the article count offset because it's set to zero; setting both using a URL variables instead of a number, allows their query values to overwritten. The scroll
parameter enables scrolling and changes to the DPL3 query (for changing the values for count
and offset
in order to scroll). The resultsheader
displays some header text along with the count and current page start number. Setting allowcachedresults=false
prevents caching, so result changes are immediately seen without the need to manually purge the cache.
The result is a static display of pages, adding two URL &DPL_count=3&DPL_offset=3
to the end of the (index.php-style) URL seen below, causes the contents of the DPL3 query on-page to change; the next 3 results in the result set are displayed. You can copy/paste the following URL into your web browser to see the result change.
https://dpl3.miraheze.org/w/index.php?title=Criteria_for_page_selection/Parameter:_scroll_(example_1)&DPL_count=3&DPL_offset=3
{{#dpl:execandexit=geturlargs}} {{#dpl: |category = Fruit examples |count = {%DPL_count:3%} |offset = {%DPL_offset:0%} |scroll = yes |resultsheader = Showing {%DPL_count:3%} pages starting from page ²{#expr:{%DPL_offset%} + 1}²:\n |allowcachedresults = false }}
Result
{{#dpl:execandexit=geturlargs}} {{#dpl: |category = Fruit examples |count = {%DPL_count:3%} |offset = {%DPL_offset:0%} |scroll = yes |resultsheader = Showing {%DPL_count:3%} pages starting from page ²{#expr:{%DPL_offset%} + 1}²:\n |allowcachedresults = false }}