Examples/Parameter: scroll (example 2)

From DynamicPageList3 Manual
Revision as of 05:29, 28 April 2022 by imported>FrozenPlum (See if this will in fact work without the aid of the template (I've tested the template, I haven't tested without it))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Please do not edit this page unless you're wanting to edit the manual itself, it is an example included in the manual.

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_offset=3

{{#dpl:
|category      = Fruit examples
|count         = {%DPL_count:3%}
|scroll        = yes
|resultsheader = Showing {%DPL_count:3%} pages starting from page ²{#expr:{%DPL_offset%} + 1}²:\n
}}

Result

{{#dpl:execandexit=geturlargs}} {{#dpl: |category = Fruit examples |count = {%DPL_count:3%} |scroll = yes |resultsheader = Showing {%DPL_count:3%} pages starting from page ²{#expr:{%DPL_offset%} + 1}²:\n }}