Jump to content

Examples/Parameter: scroll (example 1)

From DynamicPageList3 Manual
Please do not edit this page unless you're wanting to edit the manual itself, it is an example included in the manual.

Example

[edit source]

This lists pages from category Fruit examples. The count displays the first article using URL parameters, and an empty offset also using that syntax; setting both using scroll or url syntax, allows their query values to be overwritten by the URL. The scroll parameter fills the 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 page, but its display offset (page to start at) and count can be overwritten just by adding two DPL3-specific URL parameters &DPL_count=1&DPL_offset=1 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 result is loaded from the URL parameters:

  • https://dpl3.wikitide.org/wiki/Examples/Parameter:_scroll_(example_1)?DPL_count=1&DPL_offset=1 and the number can be incremented to view other pages.


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


Showing 1 pages starting from page 1:

Cookies help us deliver our services. By using our services, you agree to our use of cookies.