Examples/Parameter: scroll (example 2): Difference between revisions
imported>FrozenPlum Refine now that parent page is rewritten |
imported>FrozenPlum m FrozenPlum moved page Criteria for page selection/Parameter: scroll (example 2) to Examples/Parameter: scroll (example 2): Simplifying how things are structured |
(No difference)
|
Revision as of 22:39, 31 March 2023
Example
The count
and empty offset
displays the first 3 articles from Category:Fruit examples using Scroll/URL syntax, and scroll
fills the scroll/url parameter values. The resultsheader
uses a helper template (Template:Extension DPL scroll) to create scroll navigation, composed of magic word ({{PAGESINCATEGORY:Category}}
) and some parameters are fed to that template, so it can determine total pages, count, and amount of offset. allowcachedresults
prevents caching, to prevent the need for manual purge.
{{#dpl:execandexit=geturlargs}} {{#dpl: |category = Fruit examples |count = {%DPL_count:3%} |offset = {%DPL_offset:0%} |scroll = yes |resultsheader = ²{Extension DPL scroll¦total={{PAGESINCATEGORY:Fruit examples|R}}¦offset={%DPL_offset:0%}¦count={%DPL_count:3%}¦page={{FULLPAGENAME}}}²\n |allowcachedresults = false }}
Result
{{#dpl:execandexit=geturlargs}} {{#dpl: |category = Fruit examples |count = {%DPL_count:3%} |offset = {%DPL_offset:0%} |scroll = yes |resultsheader = ²{Extension DPL scroll¦total=7¦offset={%DPL_offset:0%}¦count={%DPL_count:3%}¦page=Examples/Parameter: scroll (example 2)}²\n |allowcachedresults = false }}