Examples/Parameter: scroll (example 1): Difference between revisions
imported>FrozenPlum (Removed redirect to Criteria for page selection/Parameter: scroll (example 2)) |
imported>FrozenPlum (Refine now that the section itself is written.) |
||
Line 6: | Line 6: | ||
==Example== |
==Example== |
||
This selects pages from [[:Category:Fruit examples]] |
This selects pages from [[:Category:Fruit examples]]. The <code>{{DPL|count}}</code> displays the first 3 articles using [[General usage and invocation syntax#Scroll/URL syntax|Scroll/URL syntax]], and an empty <code>{{DPL|offset}}</code> also using that syntax; setting both using scroll/url syntax, allows their query values to be overwritten by URL. The <code>scroll</code> parameter fills the scroll/url parameter values. The <code>resultsheader</code> displays header text to show the count and current result start number. Setting <code>allowcachedresults=''false''</code> prevents caching, so result changes are immediately seen when the URL is changed, without the need to manually purge the MediaWiki cache. |
||
The result is a static display of pages, adding two URL <code>&DPL_count=3&DPL_offset=3</code> to the end of the ([[mw:Manual:Parameters_to_index.php|index.php]]-style) URL |
The result is a static display of the first 3 pages, but their display offset (page to start at) and count can be ''overwritten'' just by adding two DPL3-specific URL parameters <code>&DPL_count=3&DPL_offset=3</code> to the end of the ([[mw:Manual:Parameters_to_index.php|index.php]]-style) URL. If you '''copy/paste the URL into your browser's URL bar''', you can see the next 3 results are loaded from the URL parameters: |
||
* <code><nowiki>https://dpl3.miraheze.org/w/index.php?title=Criteria_for_page_selection/Parameter:_scroll_(example_1)&DPL_count=3&DPL_offset=3</nowiki></code> |
* <code><nowiki>https://dpl3.miraheze.org/w/index.php?title=Criteria_for_page_selection/Parameter:_scroll_(example_1)&DPL_count=3&DPL_offset=3</nowiki></code> |
Revision as of 08:03, 28 April 2022
Example
This selects pages from Category:Fruit examples. The count
displays the first 3 articles using Scroll/URL syntax, and an empty offset
also using that syntax; setting both using scroll/url syntax, allows their query values to be overwritten by URL. The scroll
parameter fills the scroll/url parameter values. The resultsheader
displays header text to show the count and current result start number. Setting allowcachedresults=false
prevents caching, so result changes are immediately seen when the URL is changed, without the need to manually purge the MediaWiki cache.
The result is a static display of the first 3 pages, but their display offset (page to start at) and count can be overwritten just by adding two DPL3-specific URL parameters &DPL_count=3&DPL_offset=3
to the end of the (index.php-style) URL. If you copy/paste the URL into your browser's URL bar, you can see the next 3 results are loaded from the URL parameters:
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 }}