Examples/Parameter: scroll (example 2)
Example
This selects pages from Category:Fruit examples and sets the count to display the first 3 articles in that category (using a URL variable instead of a number, so the count can be overwritten as needed). The scroll
parameter enables scrolling through the category result set, and also enables support for the use of URL variables to change the DPL3 query. The resultsheader
displays text that gives the DPL_count
variable value, and the current offset value.
Adding &DPL_offset=3
to the end of the (index.php-style) URL seen below, causes the contents of the DPL3 query displayed on-page to change; the next 3 results in the result set are displayed.
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 = ²{Extension DPL scroll¦total={{PAGESINCATEGORY:{{{category|Fruit examples}}} }}¦offset={%DPL_offset:0%}¦count={%DPL_count:100%}¦page={{FULLPAGENAME}}}²\n }}
Result
{{#dpl:execandexit=geturlargs}} {{#dpl: |category = Fruit examples |count = {%DPL_count:3%} |offset = {%DPL_offset:0%} |scroll = yes |resultsheader = ²{Extension DPL scroll¦total=7¦R¦offset={%DPL_offset:0%}¦count={%DPL_count:100%}¦page=Examples/Parameter: scroll (example 2)}²\n }}