Examples/Parameter: scroll (example 1): Difference between revisions

m
Update categories and example text slightly
imported>FrozenPlum
imported>FrozenPlum
m (Update categories and example text slightly)
 
(4 intermediate revisions by 2 users not shown)
Line 6:
==Example==
 
This selects pages from [[:Category:Fruit examples]] which has a number of results. The <code>{{DPL|count}}</code> displays the first 3article using articles{{DPL|URL parameters}}, theand an empty <code>{{DPL|offset}}</code> doesn'talso changeusing thethat article count offset because it's set to zerosyntax; setting both using ascroll/url URL variables instead of a numbersyntax, allows their query values to be overwritten by URL. The <code>{{DPL|scroll}}</code> parameter enables scrolling and changes tofills the DPL3scroll/url query (for changing theparameter values for <code>count</code> and <code>offset</code> in order to scroll). The <code>{{DPL|resultsheader}}</code> displays some header text alongto withshow the count and current pageresult start number. Setting <code>{{DPL|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 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=31&DPL_offset=31</code> to the end of the ([[mw:Manual:Parameters_to_index.php|index.php]]-style) URL. seenIf below,you causes'''copy/paste the contentsURL ofinto theyour DPL3browser's queryURL on-pagebar''', toyou change;can see the next 3 results in the result setis areloaded displayed. You can copy/pastefrom the following URL into your web browser to see the result change.parameters:
 
* <code><nowiki>https://dpl3.miraheze.org/w/index.php?title=Criteria_for_page_selection/Parameter:_scroll_(example_1)&DPL_count=31&DPL_offset=31</nowiki></code>
 
<pre>
Line 17:
{{#dpl:
|category = Fruit examples
|count = {%DPL_count:31%}
|offset = {%DPL_offset:0%}
|scroll = yes
|resultsheader = Showing {%DPL_count:31%} pages starting from page ²{#expr:{%DPL_offset%} + 1}²:\n
|allowcachedresults = false
}}
Line 29:
{{#dpl:
|category = Fruit examples
|count = {%DPL_count:31%}
|offset = {%DPL_offset:0%}
|scroll = yes
|resultsheader = Showing {%DPL_count:31%} pages starting from page ²{#expr:{%DPL_offset%} + 1}²:\n
|allowcachedresults = false
}}
<noinclude>
[[Category:Select by category-related criteria‎]]
[[Category:Uses execandexit parameter]]
[[Category:Uses category parameter]]
[[Category:Uses count parameter]]
[[Category:Uses offset parameter]]
[[Category:Uses scroll parameter]]
[[Category:Uses resultsheader parameter]]
[[Category:Uses URL parameter]]
[[Category:Uses resultsfooter parameter]]
[[Category:Uses allowcachedresults parameter]]
</noinclude>
Anonymous user