Anonymous user
General usage and invocation syntax: Difference between revisions
Not sure why examples how to scroll etc were on a general use and syntax page, but make it only so this has general use and syntax (the rest moved where it belonged), and, there were 3 or for disparate places for scroll info, there's now just this syntax/reference, and the main source (has 2 identically named sections on selection critera page too)
imported>FrozenPlum m (Adjust a couple of the statements) |
imported>FrozenPlum (Not sure why examples how to scroll etc were on a general use and syntax page, but make it only so this has general use and syntax (the rest moved where it belonged), and, there were 3 or for disparate places for scroll info, there's now just this syntax/reference, and the main source (has 2 identically named sections on selection critera page too)) |
||
Line 12:
* [[Orange]]
==Invocation syntax==
===Parser extension (tag) method===
The following example would probably be used directly on an article page, but could also be included as part of a template. Parser extensions define a specific tag (in this case <code><nowiki><dpl></nowiki></code>) and a corresponding end tag (<code><nowiki></dpl></nowiki></code>). '''The text between these tags is handed over to the extension module ''just as it is''.'''
Line 45:
===Parser function method===
This example would be used inside a template, and uses the variable <code><nowiki>{{{1}}}</nowiki></code> passed to the template, which would be set to ''myPage'' here. Parser functions look like templates which start with a hash character (#). They are more closely integrated with the wiki system. They are more powerful, but their syntax looks a bit more complicated. '''The text between these tags is pre-parsed to expand wiki mark-up ''before'' being handed over to the extension module.'''
Line 264:
==Scrolling==
DPL3 supports efficient scrolling through huge result sets. Basically, the idea of backward scrolling is that the SQL statement produces a DESCENDING order (with titles below the threshold). Internally, DPL3 buffers the SQl result set and reverses its order. So, the user will see a page of entries directly below the threshold, but in ascending order.▼
The command <code>scroll=''yes''</code> must be given to enable scrolling.
===Scroll variable syntax===
▲Basically, the idea of backward scrolling is that the SQL statement produces a DESCENDING order (with titles below the threshold). Internally, DPL3 buffers the SQl result set and reverses its order. So, the user will see a page of entries directly below the threshold, but in ascending order.
If scrolling is enabled, DPL3 1.8.0 and later will take
* <code>{%DPL_offset%}</code>.
or
* <code>{%DPL_offset:defaultvalue%}</code>.
The variables are:▼
* DPL_count▼
* DPL_offset▼
* DPL_fromTitle - Will be passed to {{DPL|titlelt}} (previously title<)▼
When scrolling is enabled, DPL will interpret the following special parameters in the URL.
{| class="wikitable"
! URL Parameter
! Description
|-
|Limit number of pages to show, overwrites the values of the <code>{{DPL|count}}=</code> parameter.
|-
|Where to start, n<sup>th</sup> page, overwrites the value of the <code>{{DPL|offset}}=</code> parameter.
|-
|DPL_refresh
|{{note|'''Note:''' This feature was removed in DPL3 version 3.0.0.|error}}
|-
|DPL_findTitle
▲
|-
|DPL_toTitle
|Page name to end with, value is passed to {{DPL|titlegt}} (previously title>), which is needed for reverse scroll and which restricts the selection to articles with a page title less or equal to the specified value.
|-
|DPL_fromTitle
|Page name to start after, value is passed to {{DPL|titlelt}} (previously title<), which and restricts the selection to articles with a page title greater or equal to the specified value.
|-
|DPL_scrolldir
|direction of scroll (can be 'up' or 'down').
|}
|