Examples/Parameter: scroll (example 1): Difference between revisions
imported>FrozenPlum (FrozenPlum moved page Criteria for page selection/Parameter: scroll (example 1) to Criteria for page selection/Parameter: scroll (example 2)) |
imported>FrozenPlum (Removed redirect to Criteria for page selection/Parameter: scroll (example 2)) |
||
Line 1: | Line 1: | ||
<noinclude>{{noedit}}</noinclude><!-- |
|||
#REDIRECT [[Criteria for page selection/Parameter: scroll (example 2)]] |
|||
This is the example preloaded for testing, press "Show Preview" to see |
|||
the example working (at the bottom of the page). If you save this page, |
|||
it saves as a new section at the bottom of your '''User:Username/Sandbox''' |
|||
--> |
|||
==Example== |
|||
This selects pages from [[:Category:Fruit examples]] which has a number of results. The <code>{{DPL|count}}</code> displays the first 3 articles, the <code>{{DPL|offset}}</code> 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 <code>scroll</code> parameter enables scrolling and changes to the DPL3 query (for changing the values for <code>count</code> and <code>offset</code> in order to scroll). The <code>resultsheader</code> displays some header text along with the count and current page start number. Setting <code>allowcachedresults=''false''</code> 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 <code>&DPL_count=3&DPL_offset=3</code> to the end of the ([[mw:Manual:Parameters_to_index.php|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. |
|||
* <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> |
|||
<pre> |
|||
{{#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 |
|||
}} |
|||
</pre> |
|||
==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 |
|||
}} |
|||
<noinclude> |
|||
[[Category:Select by category-related criteria]] |
|||
[[Category:Uses category parameter]] |
|||
[[Category:Uses count parameter]] |
|||
[[Category:Uses offset parameter]] |
|||
[[Category:Uses scroll parameter]] |
|||
[[Category:Uses resultsheader parameter]] |
|||
[[Category:Uses allowcachedresults parameter]] |
|||
</noinclude> |
Revision as of 06:41, 28 April 2022
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 }}